CentOS7.4怎么用rpm包安裝mysql5.7.17

本篇內容介紹了“CentOS7.4怎么用rpm包安裝MySQL5.7.17”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!

創新互聯是網站建設專家,致力于互聯網品牌建設與網絡營銷,專業領域包括成都做網站、網站建設、電商網站制作開發、小程序開發、微信營銷、系統平臺開發,與其他網站設計及系統開發公司不同,我們的整合解決方案結合了恒基網絡品牌建設經驗和互聯網整合營銷的理念,并將策略和執行緊密結合,且不斷評估并優化我們的方案,為客戶提供全方位的互聯網品牌整合方案!

操作系統環境:

  1. CentOS Linux release 7.4.1708 (Core)

MySQL版本:5.7.17

一,卸載mariadb-lib

  1. [root@iZ2ze6jo3o3bqbcongnypqZ lib]# rpm -qa|grep mariadb

  2. mariadb-libs-5.5.56-2.el7.x86_64 

  3. [root@iZ2ze6jo3o3bqbcongnypqZ ~]# yum -y remove mariadb-libs-5.5.56-2.el7.x86_64

  4. Loaded plugins: fastestmirror

  5. Resolving Dependencies

  6. --> Running transaction check

  7. ---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be erased

  8. --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64

  9. --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64

  10. --> Running transaction check

  11. ---> Package postfix.x86_64 2:2.10.1-6.el7 will be erased

  12. --> Processing Dependency: /usr/sbin/sendmail for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64

  13. --> Restarting Dependency Resolution with new changes.

  14. --> Running transaction check

  15. ---> Package redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1 will be erased

  16. --> Finished Dependency Resolution

  17. Dependencies Resolved

  18. ==============================================================================================================================================================================================================================================================================

  19.  Package Arch Version Repository Size

  20. ==============================================================================================================================================================================================================================================================================

  21. Removing:

  22.  mariadb-libs x86_64 1:5.5.56-2.el7 @base 4.4 M

  23. Removing for dependencies:

  24.  postfix x86_64 2:2.10.1-6.el7 @anaconda 12 M

  25.  redhat-lsb-core x86_64 4.1-27.el7.centos.1 @base 45 k

  26. Transaction Summary

  27. ==============================================================================================================================================================================================================================================================================

  28. Remove 1 Package (+2 Dependent packages)

  29. Installed size: 17 M

  30. Downloading packages:

  31. Running transaction check

  32. Running transaction test

  33. Transaction test succeeded

  34. Running transaction

  35.   Erasing : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 1/3 

  36.   Erasing : 2:postfix-2.10.1-6.el7.x86_64 2/3 

  37.   Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 3/3 

  38.   Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/3 

  39.   Verifying : 2:postfix-2.10.1-6.el7.x86_64 2/3 

  40.   Verifying : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 3/3 

  41. Removed:

  42.   mariadb-libs.x86_64 1:5.5.56-2.el7 

  43. Dependency Removed:

  44.   postfix.x86_64 2:2.10.1-6.el7 redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1 

  45. Complete!

undefined


二,下載mysql5.7.17rpm安裝包,具體是mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar

  1. wget https://downloads.mysql.com/archives/get/file/mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar

三,解壓


  1. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# tar -xvf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar


  1. -rw-r--r-- 1 7155 31415 25037548 Nov 30 2016 mysql-community-client-5.7.17-1.el7.x86_64.rpm

  2. -rw-r--r-- 1 7155 31415 277812 Nov 30 2016 mysql-community-common-5.7.17-1.el7.x86_64.rpm

  3. -rw-r--r-- 1 7155 31415 3774276 Nov 30 2016 mysql-community-devel-5.7.17-1.el7.x86_64.rpm

  4. -rw-r--r-- 1 7155 31415 45474744 Nov 30 2016 mysql-community-embedded-5.7.17-1.el7.x86_64.rpm

  5. -rw-r--r-- 1 7155 31415 23925668 Nov 30 2016 mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm

  6. -rw-r--r-- 1 7155 31415 126047424 Nov 30 2016 mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm

  7. -rw-r--r-- 1 7155 31415 2237116 Nov 30 2016 mysql-community-libs-5.7.17-1.el7.x86_64.rpm

  8. -rw-r--r-- 1 7155 31415 2112724 Nov 30 2016 mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm

  9. -rw-r--r-- 1 7155 31415 54571580 Nov 30 2016 mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm

  10. -rw-r--r-- 1 7155 31415 169496800 Nov 30 2016 mysql-community-server-5.7.17-1.el7.x86_64.rpm

  11. -rw-r--r-- 1 7155 31415 14478292 Nov 30 2016 mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm

  12. -rw-r--r-- 1 7155 31415 116682212 Nov 30 2016 mysql-community-test-5.7.17-1.el7.x86_64.rpm

四,安裝

要按照如下順序安裝

  1. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm

  2. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm

  3. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-libs-compat-5.7.17-1.el7.x86_64

  4. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-devel-5.7.17-1.el7.x86_64

  5. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm

  6. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

在安裝server的時候報錯


  1. [root@iZ2ze6jo3o3bqbcongnypoZ ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

  2. warning: mysql-community-server-5.7.17-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

  3. error: Failed dependencies:

  4.     libaio.so.1()(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64

  5.     libaio.so.1(LIBAIO_0.1)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64

  6.     libaio.so.1(LIBAIO_0.4)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64


缺少libaio.so,用yum安裝上:


  1. [root@iZ2ze6jo3o3bqbcongnypoZ ~]# yum install libaio*

  2. Loaded plugins: fastestmirror

  3. Loading mirror speeds from cached hostfile

  4.  * base: mirrors.cloud.aliyuncs.com

  5.  * epel: mirrors.cloud.aliyuncs.com

  6.  * extras: mirrors.cloud.aliyuncs.com

  7.  * updates: mirrors.cloud.aliyuncs.com

  8. Resolving Dependencies

  9. --> Running transaction check

  10. ---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed

  11. ---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed

  12. --> Finished Dependency Resolution

  13. Dependencies Resolved

  14. ==============================================================================================================================================================================================================================================================================

  15.  Package Arch Version Repository Size

  16. ==============================================================================================================================================================================================================================================================================

  17. Installing:

  18.  libaio x86_64 0.3.109-13.el7 base 24 k

  19.  libaio-devel x86_64 0.3.109-13.el7 base 13 k

  20. Transaction Summary

  21. ==============================================================================================================================================================================================================================================================================

  22. Install 2 Packages

  23. Total download size: 37 k

  24. Installed size: 46 k

  25. Is this ok [y/d/N]: y

  26. Downloading packages:

  27. (1/2): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00 

  28. (2/2): libaio-devel-0.3.109-13.el7.x86_64.rpm | 13 kB 00:00:00 

  29. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  30. Total 243 kB/s | 37 kB 00:00:00 

  31. Running transaction check

  32. Running transaction test

  33. Transaction test succeeded

  34. Running transaction

  35. Warning: RPMDB altered outside of yum.

  36.   Installing : libaio-0.3.109-13.el7.x86_64 1/2 

  37.   Installing : libaio-devel-0.3.109-13.el7.x86_64 2/2 

  38.   Verifying : libaio-0.3.109-13.el7.x86_64 1/2 

  39.   Verifying : libaio-devel-0.3.109-13.el7.x86_64 2/2 

  40. Installed:

  41.   libaio.x86_64 0:0.3.109-13.el7 libaio-devel.x86_64 0:0.3.109-13.el7 

  42. Complete!


五,找到密碼:


找到數據庫的初始密碼,最后一行冒號后面的就是

  1. [root@iZ2ze6jo3o3bqbcongnypqZ mysql]# cat /var/log/mysqld.log 

  2. 2017-11-03T08:41:25.257336Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

  3. 2017-11-03T08:41:26.329912Z 0 [Warning] InnoDB: New log files created, LSN=45790

  4. 2017-11-03T08:41:26.543807Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

  5. 2017-11-03T08:41:26.566468Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: c79a2e4b-c072-11e7-b809-00163e0ad76e.

  6. 2017-11-03T08:41:26.570349Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

  7. 2017-11-03T08:41:26.571065Z 1 [Note] A temporary password is generated for root@localhost: 7PkQ:l<p2cpH


六,啟動mysql


  1. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# systemctl start mysqld.service

  2. [root@iZ2ze6jo3o3bqbcongnyppZ ~]# mysql -uroot -p

  3. Enter password: 

  4. Welcome to the MySQL monitor. Commands end with ; or \g.

  5. Your MySQL connection id is 3

  6. Server version: 5.7.17

  7. Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

  8. Oracle is a registered trademark of Oracle Corporation and/or its

  9. affiliates. Other names may be trademarks of their respective

  10. owners.

  11. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  12. mysql>

七,修改密碼

臨時密碼過期了,需要修改
  1. mysql> show databases;

  2. ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.


用如下命令修改

  1. ALTER USER 'root'@'localhost' IDENTIFIED BY 'yournew_password';

“CentOS7.4怎么用rpm包安裝mysql5.7.17”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注創新互聯網站,小編將為大家輸出更多高質量的實用文章!

標題名稱:CentOS7.4怎么用rpm包安裝mysql5.7.17
標題URL:http://m.kartarina.com/article6/jeopog.html

成都網站建設公司_創新互聯,為您提供微信公眾號網站改版關鍵詞優化網站營銷面包屑導航域名注冊

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

h5響應式網站建設
主站蜘蛛池模板: 亚洲精品无码国产| 久久无码精品一区二区三区| 国产aⅴ无码专区亚洲av麻豆| 久久久久无码国产精品不卡| 亚洲AV无码久久| 精品无码国产一区二区三区麻豆 | 亚洲日韩一区二区一无码| 无码AV中文一区二区三区| 免费无码成人AV片在线在线播放| 日韩av无码中文无码电影| 亚洲av永久中文无码精品| 亚洲av中文无码乱人伦在线播放| 精品国产a∨无码一区二区三区| 极品粉嫩嫩模大尺度无码视频| 亚洲成av人无码亚洲成av人| 一区二区三区人妻无码| 亚洲AV无码乱码精品国产| 中文字幕乱偷无码av先锋蜜桃| 久久久久成人精品无码| 国产午夜鲁丝片AV无码免费| 伊人天堂av无码av日韩av| 人妻丝袜中文无码av影音先锋专区| 久久久久成人精品无码| 无码AV一区二区三区无码| HEYZO无码中文字幕人妻| 亚洲AV无码一区二区三区网址| 欧洲成人午夜精品无码区久久 | 国产成人无码区免费网站| 人妻丰满?V无码久久不卡| 在人线av无码免费高潮喷水| 四虎成人精品无码| 日韩人妻无码精品久久免费一| 野花在线无码视频在线播放| 久久无码一区二区三区少妇| 亚洲国产av无码精品| 国产亚洲大尺度无码无码专线| 无码人妻一区二区三区精品视频| 内射无码午夜多人| 国产成人无码AV一区二区在线观看| 超清无码无卡中文字幕| 人妻系列AV无码专区|