CentOS7.4使用rpm包安裝mysql5.7.17
作業系統環境:
二,下載mysql5.7.17rpm安裝包,具體是mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
三,解壓
四,安裝
要按照如下順序安裝
在安裝server的時候報錯
缺少libaio.so,用yum安裝上:
五,找到密碼:
找到資料庫的初始密碼,最後一行冒號後面的就是
六,啟動mysql
七,修改密碼
臨時密碼過期了,需要修改
用如下命令修改
- CentOS Linux release 7.4.1708 (Core)
MySQL版本:5.7.17
一,解除安裝mariadb-lib-
[root@iZ2ze6jo3o3bqbcongnypqZ lib]# rpm -qa|grep mariadb
-
mariadb-libs-5.5.56-2.el7.x86_64
-
-
[root@iZ2ze6jo3o3bqbcongnypqZ ~]# yum -y remove mariadb-libs-5.5.56-2.el7.x86_64
-
Loaded plugins: fastestmirror
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be erased
-
--> 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
-
--> Running transaction check
-
---> Package postfix.x86_64 2:2.10.1-6.el7 will be erased
-
--> Processing Dependency: /usr/sbin/sendmail for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
-
--> Restarting Dependency Resolution with new changes.
-
--> Running transaction check
-
---> Package redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1 will be erased
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
==============================================================================================================================================================================================================================================================================
-
Package Arch Version Repository Size
-
==============================================================================================================================================================================================================================================================================
-
Removing:
-
mariadb-libs x86_64 1:5.5.56-2.el7 @base 4.4 M
-
Removing for dependencies:
-
postfix x86_64 2:2.10.1-6.el7 @anaconda 12 M
-
redhat-lsb-core x86_64 4.1-27.el7.centos.1 @base 45 k
-
-
Transaction Summary
-
==============================================================================================================================================================================================================================================================================
-
Remove 1 Package (+2 Dependent packages)
-
-
Installed size: 17 M
-
Downloading packages:
-
Running transaction check
-
Running transaction test
-
Transaction test succeeded
-
Running transaction
-
Erasing : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 1/3
-
Erasing : 2:postfix-2.10.1-6.el7.x86_64 2/3
-
Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 3/3
-
Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/3
-
Verifying : 2:postfix-2.10.1-6.el7.x86_64 2/3
-
Verifying : redhat-lsb-core-4.1-27.el7.centos.1.x86_64 3/3
-
-
Removed:
-
mariadb-libs.x86_64 1:5.5.56-2.el7
-
-
Dependency Removed:
-
postfix.x86_64 2:2.10.1-6.el7 redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1
-
- Complete!
二,下載mysql5.7.17rpm安裝包,具體是mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
- wget https://downloads.mysql.com/archives/get/file/mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
- [root@iZ2ze6jo3o3bqbcongnyppZ ~]# tar -xvf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
-
-rw-r--r-- 1 7155 31415 25037548 Nov 30 2016 mysql-community-client-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 277812 Nov 30 2016 mysql-community-common-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 3774276 Nov 30 2016 mysql-community-devel-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 45474744 Nov 30 2016 mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 23925668 Nov 30 2016 mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 126047424 Nov 30 2016 mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 2237116 Nov 30 2016 mysql-community-libs-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 2112724 Nov 30 2016 mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 54571580 Nov 30 2016 mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 169496800 Nov 30 2016 mysql-community-server-5.7.17-1.el7.x86_64.rpm
-
-rw-r--r-- 1 7155 31415 14478292 Nov 30 2016 mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm
- -rw-r--r-- 1 7155 31415 116682212 Nov 30 2016 mysql-community-test-5.7.17-1.el7.x86_64.rpm
要按照如下順序安裝
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm
- [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-libs-compat-5.7.17-1.el7.x86_64
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-devel-5.7.17-1.el7.x86_64
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm
- [root@iZ2ze6jo3o3bqbcongnyppZ ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm
-
[root@iZ2ze6jo3o3bqbcongnypoZ ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm
-
warning: mysql-community-server-5.7.17-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
-
error: Failed dependencies:
-
libaio.so.1()(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
-
libaio.so.1(LIBAIO_0.1)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
- libaio.so.1(LIBAIO_0.4)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
缺少libaio.so,用yum安裝上:
-
[root@iZ2ze6jo3o3bqbcongnypoZ ~]# yum install libaio*
-
Loaded plugins: fastestmirror
-
Loading mirror speeds from cached hostfile
-
* base: mirrors.cloud.aliyuncs.com
-
* epel: mirrors.cloud.aliyuncs.com
-
* extras: mirrors.cloud.aliyuncs.com
-
* updates: mirrors.cloud.aliyuncs.com
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
-
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
==============================================================================================================================================================================================================================================================================
-
Package Arch Version Repository Size
-
==============================================================================================================================================================================================================================================================================
-
Installing:
-
libaio x86_64 0.3.109-13.el7 base 24 k
-
libaio-devel x86_64 0.3.109-13.el7 base 13 k
-
-
Transaction Summary
-
==============================================================================================================================================================================================================================================================================
-
Install 2 Packages
-
-
Total download size: 37 k
-
Installed size: 46 k
-
Is this ok [y/d/N]: y
-
Downloading packages:
-
(1/2): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
-
(2/2): libaio-devel-0.3.109-13.el7.x86_64.rpm | 13 kB 00:00:00
-
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
Total 243 kB/s | 37 kB 00:00:00
-
Running transaction check
-
Running transaction test
-
Transaction test succeeded
-
Running transaction
-
Warning: RPMDB altered outside of yum.
-
Installing : libaio-0.3.109-13.el7.x86_64 1/2
-
Installing : libaio-devel-0.3.109-13.el7.x86_64 2/2
-
Verifying : libaio-0.3.109-13.el7.x86_64 1/2
-
Verifying : libaio-devel-0.3.109-13.el7.x86_64 2/2
-
-
Installed:
-
libaio.x86_64 0:0.3.109-13.el7 libaio-devel.x86_64 0:0.3.109-13.el7
-
- Complete!
五,找到密碼:
找到資料庫的初始密碼,最後一行冒號後面的就是
-
[root@iZ2ze6jo3o3bqbcongnypqZ mysql]# cat /var/log/mysqld.log
-
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).
-
2017-11-03T08:41:26.329912Z 0 [Warning] InnoDB: New log files created, LSN=45790
-
2017-11-03T08:41:26.543807Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
-
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.
-
2017-11-03T08:41:26.570349Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
- 2017-11-03T08:41:26.571065Z 1 [Note] A temporary password is generated for root@localhost: 7PkQ:l<p2cpH
六,啟動mysql
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# systemctl start mysqld.service
-
[root@iZ2ze6jo3o3bqbcongnyppZ ~]# mysql -uroot -p
-
Enter password:
-
Welcome to the MySQL monitor. Commands end with ; or \g.
-
Your MySQL connection id is 3
-
Server version: 5.7.17
-
-
Copyright (c) 2000, 2016, 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>
臨時密碼過期了,需要修改
-
mysql> show databases;
- ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
用如下命令修改
- ALTER USER 'root'@'localhost' IDENTIFIED BY 'yournew_password';
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2146801/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS下使用rpm包安裝MySQLCentOSMySql
- mysql安裝------RPM包安裝及解除安裝MySql
- RPM 包安裝報錯
- rpm包安裝和管理
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- rpm包安裝升級與解除安裝
- Postgresql Linux版本安裝——RPM包安裝SQLLinux
- RPM包安裝與介紹
- linux jdk rpm包安裝LinuxJDK
- RPM應用——查詢(已安裝包和未安裝包)
- RPM包的安裝與升級
- mysql 5.6 for linux (rpm包安裝)MySqlLinux
- rpm包方式安裝Percona serverServer
- 強制安裝一個RPM包
- 使用CheckInstall從原始碼製作RPM安裝包原始碼
- linux 安裝ps需要先安裝的rpm包Linux
- redhat配置yum環境安裝rpm包Redhat
- 檢查RPM包是否已經安裝
- Greenplum_原始碼編譯安裝和RPM包安裝原始碼編譯
- (轉)CentOS 下 rpm包與 yum 安裝與解除安裝CentOS
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- yum安裝軟體之後如何儲存rpm安裝包
- yum/dnf/rpm 等 檢視rpm 包安裝路徑 (fedora 中 pygtk 包內容安裝到哪裡了)
- centos以RPM包方式安裝redis的方法CentOSRedis
- 在 Fedora 中安裝替代版本的 RPM 包
- mysql8.0.30的RPM包安裝方法MySql
- Percona MySQL 5.6 RPM包方式安裝流程MySql
- rpm包 手工安裝OEM 12c agent
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- linux怎樣檢視rpm安裝包的安裝路徑Linux
- Yum命令之僅下載rpm安裝包且不安裝
- Mysql 5.7在OL 6上以RPM包安裝MySql
- Gitlab環境快速部署(RPM包方式安裝)Gitlab
- centos 安裝erlang rpm包互相依賴問題CentOS
- mysql5.7.17 64位rhel6.5下安裝MySql
- 【Linux】Linux軟體安裝管理1 rpm軟體包安裝Linux
- rpm:虛擬包:空白包:欺騙包:do nothing包:滿足現有rpm包安裝依賴的要求
- 徹底解除安裝rpm軟體包的指令碼指令碼