最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

centos7.3 安裝mysql5.7.18的詳細(xì)教程

 更新時(shí)間:2017年06月06日 14:07:51   投稿:mrr  
這篇文章主要介紹了centos7.3 安裝mysql5.7.18的詳細(xì)教程,需要的朋友可以參考下

1查看Linux發(fā)行版本

[root@typecodes ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

2 下載MySQL官方的Yum Repository

根據(jù)Linux發(fā)行版本(CentOS、Fedora都屬于紅帽系),從mysql官方(http://dev.mysql.com/downloads/repo/yum/)獲取Yum Repository。

[root@typecodes ~]# wget -i http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
--2016-02-03 18:36:02-- http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm [following]
--2016-02-03 18:36:04-- http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 104.102.164.25
Connecting to repo.mysql.com (repo.mysql.com)|104.102.164.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8984 (8.8K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-7.noarch.rpm'
100%[=============================================================================================================================>] 8,984  --.-K/s in 0s
2016-02-03 18:36:07 (68.4 MB/s) - ‘mysql57-community-release-el7-7.noarch.rpm' saved [8984/8984]
3 安裝MySQL的Yum Repository
安裝完MySQL的Yum Repository,每次執(zhí)行yum update都會(huì)檢查MySQL是否更新。
[root@typecodes ~]# yum -y install mysql57-community-release-el7-7.noarch.rpm
Loaded plugins: axelget, fastestmirror, langpacks
Examining mysql57-community-release-el7-7.noarch.rpm: mysql57-community-release-el7-7.noarch
Marking mysql57-community-release-el7-7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
 Package          Arch      Version     Repository             Size
=======================================================================================================================================================================
Installing:
 mysql57-community-release      noarch      el7-7      /mysql57-community-release-el7-7.noarch      7.8 k
Transaction Summary
=======================================================================================================================================================================
Install 1 Package
Total size: 7.8 k
Installed size: 7.8 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : mysql57-community-release-el7-7.noarch                            1/1 
 Verifying : mysql57-community-release-el7-7.noarch                           1/1
Installed:
 mysql57-community-release.noarch 0:el7-7
Complete!

3 安裝MySQL數(shù)據(jù)庫的服務(wù)器版本

[root@typecodes ~]# yum -y install mysql-community-server
Loaded plugins: axelget, fastestmirror, langpacks
No metadata available for base
No metadata available for epel
No metadata available for extras
repomd.xml                                  | 2.5 kB 00:00:00  
update mysql-connectors-community metadata successfully
repomd.xml                                  | 2.5 kB 00:00:00  
update mysql-tools-community metadata successfully
repomd.xml                                  | 2.5 kB 00:00:00  
update mysql57-community metadata successfully
No metadata available for updates
mysql-connectors-community                              | 2.5 kB 00:00:00  
mysql-tools-community                               | 2.5 kB 00:00:00  
mysql57-community                                | 2.5 kB 00:00:00  
(1/3): mysql-tools-community/x86_64/primary_db                         | 24 kB 00:00:01  
(2/3): mysql57-community/x86_64/primary_db                          | 28 kB 00:00:01  
(3/3): mysql-connectors-community/x86_64/primary_db                        | 8.6 kB 00:00:02  
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.neusoft.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.10-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.10-1.el7 for package: mysql-community-server-5.7.10-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) = 5.7.10-1.el7 for package: mysql-community-server-5.7.10-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.10-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) = 5.7.10-1.el7 for package: mysql-community-client-5.7.10-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.10-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.44-2.el7.centos will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.10-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.10-1.el7 will be obsoleting
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
 Package           Arch       Version        Repository        Size
=======================================================================================================================================================================
Installing:
 mysql-community-libs        x86_64      5.7.10-1.el7       mysql57-community      2.2 M
  replacing mariadb-libs.x86_64 1:5.5.44-2.el7.centos
 mysql-community-libs-compat      x86_64      5.7.10-1.el7       mysql57-community      2.0 M
  replacing mariadb-libs.x86_64 1:5.5.44-2.el7.centos
 mysql-community-server        x86_64      5.7.10-1.el7       mysql57-community      142 M
Installing for dependencies:
 mysql-community-client        x86_64      5.7.10-1.el7       mysql57-community       24 M
 mysql-community-common        x86_64      5.7.10-1.el7       mysql57-community      269 k
Transaction Summary
=======================================================================================================================================================================
Install 3 Packages (+2 Dependent packages)
Total download size: 171 M
Downloading packages:
mysql-community-server-5.7.10-1.el7.x86_64.rpm                         | 142 MB 00:03:42  
mysql-community-libs-compat-5.7.10-1.el7.x86_64.rpm                        | 2.0 MB 00:00:03  
mysql-community-libs-5.7.10-1.el7.x86_64.rpm                         | 2.2 MB 00:00:05  
mysql-community-client-5.7.10-1.el7.x86_64.rpm                         | 24 MB 00:00:41  
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.10-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY00 ETA 
Public key for mysql-community-common-5.7.10-1.el7.x86_64.rpm is not installed
mysql-community-common-5.7.10-1.el7.x86_64.rpm                         | 269 kB 00:00:01  
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid  : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package : mysql57-community-release-el7-7.noarch (@/mysql57-community-release-el7-7.noarch)
 From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : mysql-community-common-5.7.10-1.el7.x86_64                           1/6 
 Installing : mysql-community-libs-5.7.10-1.el7.x86_64                           2/6 
 Installing : mysql-community-client-5.7.10-1.el7.x86_64                           3/6 
 Installing : mysql-community-server-5.7.10-1.el7.x86_64                           4/6 
 Installing : mysql-community-libs-compat-5.7.10-1.el7.x86_64                          5/6 
 Erasing : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                           6/6 
 Verifying : mysql-community-server-5.7.10-1.el7.x86_64                           1/6 
 Verifying : mysql-community-libs-compat-5.7.10-1.el7.x86_64                          2/6 
 Verifying : mysql-community-common-5.7.10-1.el7.x86_64                           3/6 
 Verifying : mysql-community-libs-5.7.10-1.el7.x86_64                           4/6 
 Verifying : mysql-community-client-5.7.10-1.el7.x86_64                           5/6 
 Verifying : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                           6/6
Installed:
 mysql-community-libs.x86_64 0:5.7.10-1.el7   mysql-community-libs-compat.x86_64 0:5.7.10-1.el7   mysql-community-server.x86_64 0:5.7.10-1.el7
Dependency Installed:
 mysql-community-client.x86_64 0:5.7.10-1.el7          mysql-community-common.x86_64 0:5.7.10-1.el7
Replaced:
 mariadb-libs.x86_64 1:5.5.44-2.el7.centos
Complete!
[root@typecodes ~]# clear

最后的截圖:

yum安裝mysql5.7.10

4 啟動(dòng)數(shù)據(jù)庫:

[root@typecodes ~]# systemctl start mysqld.service

然后使用命令systemctl status mysqld.service查看MySQL數(shù)據(jù)庫啟動(dòng)后的服務(wù)狀態(tài):

systemctl命令查看MySQL服務(wù)狀態(tài)

5 獲取初始密碼

使用YUM安裝并啟動(dòng)MySQL服務(wù)后,MySQL進(jìn)程會(huì)自動(dòng)在進(jìn)程日志中打印root用戶的初始密碼:

#######從mysql進(jìn)程日志中獲取root用戶的初始密碼:ra%yk7urCBIh
[root@typecodes ~]# grep "password" /var/log/mysqld.log
2016-02-03T10:42:17.272166Z 1 [Note] A temporary password is generated for root@localhost: ra%yk7urCBIh
2016-02-03T10:42:36.776875Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:42:52.063138Z 3 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:42:57.564373Z 4 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:43:01.477007Z 5 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:46:03.642008Z 6 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:46:11.217889Z 7 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2016-02-03T10:47:44.755199Z 0 [Note] Shutting down plugin 'validate_password'
2016-02-03T10:47:46.505844Z 0 [Note] Shutting down plugin 'sha256_password'
2016-02-03T10:47:46.505851Z 0 [Note] Shutting down plugin 'mysql_native_password'

6 修改root用戶密碼

使用小節(jié)5中獲取的root用戶的初始密碼,然后進(jìn)行修改:

set global validate_password_policy =0;//默認(rèn)是1,即MEDIUM,所以剛開始設(shè)置的密碼必須符合長度,且必須含有數(shù)字,小寫或大寫字母,特殊字符。

set global validate_password_length=4;//指定了密碼中數(shù)據(jù)的長度
alter user root@localhost identified by 'crow';//修改密碼

增加遠(yuǎn)程訪問權(quán)限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'crow' WITH GRANT OPTION;
FLUSH PRIVILEGES;

退出mysql,然后重啟服務(wù)

systemctl restart mysqld

防火墻打開3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent

重啟防火墻

firewall-cmd --reload
[root@typecodes ~]# mysql -uroot -p
Enter password:    #######輸入默認(rèn)的root密碼后回車
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

7 安裝完畢

至此,使用在CentOS7中使用YUM方法安裝MySQL5.7.10數(shù)據(jù)庫完畢。如下所示,可以使用新的root密碼登陸MySQL了。

[root@typecodes ~]# mysql -uroot -ppassword
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show databases;
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| performance_schema |
| sys    |
+--------------------+
4 rows in set (0.00 sec)
mysql> clear
mysql> exit
Bye
[root@typecodes ~]# clear

附錄1:查看MySQL數(shù)據(jù)庫的配置信息

MySQL的配置文件依然是/etc/my.cnf,其它安裝信息可以通過mysql_config命令查看。其中,動(dòng)態(tài)庫文件存放在/usr/lib64/mysql目錄下。

mysql_config命令查看mysql數(shù)據(jù)庫的安裝信息

附錄2:對(duì)于C/C++等開發(fā)者

由于需要用到類似mysql.h等頭文件,需要執(zhí)行下面的命令安裝mysql開發(fā)版本即可。

[root@typecodes ~]# yum -y install mysql-community-devel

附錄3:刪除MySQL的Repository

因?yàn)樾」?jié)3中安裝了MySQL的Yum Repository,所以以后每次執(zhí)行yum操作時(shí),都會(huì)去檢查更新。如果想要去掉這種自動(dòng)檢查操作的話,可以使用如下命令卸載MySQL的Repository即可。

[root@typecodes ~]# yum -y remove mysql57-community-release-el7-7.noarch
update 2017.04.10 11:10

使用上面的yum方法也可以安裝目前mysql官網(wǎng)上最新的版本mysql5.7.18。只要替換小節(jié)2中rmp包的版本即可,后續(xù)操作步驟不變。

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

以上所述是小編給大家介紹的centos7.3 安裝mysql5.7.18的詳細(xì)教程,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • 分析MySQL并發(fā)下的問題及解決方法

    分析MySQL并發(fā)下的問題及解決方法

    本篇文章給大家詳細(xì)分析了MySQL在并發(fā)場景下的問題及解決思路,對(duì)這方面有興趣的朋友參考學(xué)習(xí)下吧。
    2018-01-01
  • MySQL 主主同步配置步驟

    MySQL 主主同步配置步驟

    創(chuàng)建同步用戶、修改 /etc/my.cnf 配置文件,為其添加以下內(nèi)容、分別重啟服務(wù)器ODD EVEN 上的mysql服務(wù)
    2013-05-05
  • MySQL使用innobackupex備份連接服務(wù)器失敗的解決方法

    MySQL使用innobackupex備份連接服務(wù)器失敗的解決方法

    這篇文章主要為大家詳細(xì)介紹了MySQL使用innobackupex備份連接服務(wù)器失敗的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-02-02
  • MySQL 5.6 中的 TIMESTAMP 和 explicit_defaults_for_timestamp 參數(shù)

    MySQL 5.6 中的 TIMESTAMP 和 explicit_defaults_for_timestamp 參數(shù)

    這篇文章主要介紹了MySQL 5.6 中的 TIMESTAMP 和 explicit_defaults_for_timestamp 參數(shù),需要的朋友可以參考下
    2015-08-08
  • MySQL中WITH?AS語句的使用方法舉例

    MySQL中WITH?AS語句的使用方法舉例

    在MySQL中WITH AS語法用于創(chuàng)建一個(gè)臨時(shí)的命名查詢(也稱為子查詢),這些子查詢可以在后續(xù)的查詢中引用,從而簡化查詢語句的編寫,這篇文章主要給大家介紹了關(guān)于MySQL中WITH?AS語句的使用方法,需要的朋友可以參考下
    2024-06-06
  • MySql數(shù)據(jù)庫分布式存儲(chǔ)配置實(shí)操步驟

    MySql數(shù)據(jù)庫分布式存儲(chǔ)配置實(shí)操步驟

    這篇文章主要為大家介紹了MySql數(shù)據(jù)庫分布式存儲(chǔ)配置實(shí)操步驟詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-07-07
  • 對(duì)比MySQL中int、char以及varchar的性能

    對(duì)比MySQL中int、char以及varchar的性能

    在本篇文章中我們給大家分享了關(guān)于MySQL中int、char以及varchar的性能對(duì)比的相關(guān)內(nèi)容,有興趣的朋友們學(xué)習(xí)下。
    2018-10-10
  • MySQL中索引失效的常見場景與規(guī)避方法

    MySQL中索引失效的常見場景與規(guī)避方法

    這篇文章主要給大家介紹了關(guān)于MySQL中索引失效的常見場景與規(guī)避的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用MySQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12
  • MySQL使用binlog日志恢復(fù)數(shù)據(jù)的方法步驟

    MySQL使用binlog日志恢復(fù)數(shù)據(jù)的方法步驟

    binlog日志是用于記錄所有修改數(shù)據(jù)庫內(nèi)容的操作,本文主要介紹了MySQL使用binlog日志恢復(fù)數(shù)據(jù)的方法步驟,具有一定的參考價(jià)值,感興趣的可以了解一下
    2025-03-03
  • MySQL Flink Watermark實(shí)現(xiàn)事件時(shí)間處理的關(guān)鍵技術(shù)

    MySQL Flink Watermark實(shí)現(xiàn)事件時(shí)間處理的關(guān)鍵技術(shù)

    Flink Watermark是Flink流處理框架中實(shí)現(xiàn)事件時(shí)間處理的關(guān)鍵技術(shù)之一。它是通過一種機(jī)制來解決數(shù)據(jù)亂序和延遲的問題,使得Flink可以在處理遲到的數(shù)據(jù)時(shí)保證結(jié)果的準(zhǔn)確性。Flink Watermark可以在數(shù)據(jù)流中插入一個(gè)時(shí)間戳,將數(shù)據(jù)流轉(zhuǎn)化為具有時(shí)間維度的數(shù)據(jù)集合
    2023-05-05

最新評(píng)論

兴海县| 离岛区| 垦利县| 万山特区| 泸定县| 峨边| 宜阳县| 荔波县| 本溪| 探索| 天气| 通河县| 临安市| 宁德市| 淳安县| 长乐市| 安吉县| 合肥市| 兴城市| 章丘市| 呼和浩特市| 开鲁县| 彩票| 辽阳市| 杂多县| 邵阳市| 东宁县| 新竹县| 井研县| 江西省| 古浪县| 湖北省| 阿瓦提县| 体育| 龙泉市| 阿合奇县| 孟州市| 台南县| 日照市| 中卫市| 平邑县|