Install mysql 5.7.18 and centos5.7.18 using the rpm package in CentOS 7
I have been using MySQL recently. I have installed and written mysql in mysql-Linux using other methods. This time I installed MySQL in rpm format. I tried it and felt that this installation mode was relatively simple.
Uninstall MariaDB
MariaDB is installed on centos7 by default instead of mysql. MariaDB may conflict with mysql, so MariaDB is uninstalled first.
1. Check the packages related to MariaDB installed.
Rpm-qa | grep mariadb
2. Check the installed MariaDB yum package. The package should be determined based on the results of the rpm command.
Yum list mariadb-libs
3. Remove the installed MariaDB-related yum package. The package name must be determined based on the yum list Command result. In this step, the root permission is required.
Yum remove mariadb-libs
Download mysql rpm package
The following is the official website:
Https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar
Use rpm to install mysql
The following steps require the root permission and the dependencies between packages. Therefore, the rpm command must be executed in order.
mkdir mysqltar -xv -f mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar -C mysqlcd mysqlrpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpmrpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpmrpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
Problems:
1) libaio. so.1 () (64bit) is needed by MySQL-server
Solution:
Install libaio-0.3.107-10.el6.x86_64.rpm
①:
Http://mirror.centos.org/centos/6/ OS /x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
2 run: rpm-ivh libaio-0.3.107-10.el6.x86_64.rpm
2) net-tools is needed
Solution:
Yum install net-tools
3) perl (Getopt: Long) is required by the mysql-community-server-5.7.18-1.el7.x86_64
Solution:
Yum install perl
After the installation is successful, delete the installation files and temporary files.
Log on to mysql and change the initial password.
The following steps require the root permission.
1. because you do not know the password at the beginning, first modify the configuration file/etc/my. cnf so that mysql can skip permission verification during logon. Add a row:
vi /etc.my.cnfskip-grant-tables
2. Change the user and group of the MySQL database directory, and then start mysql
Chown-R mysql: mysql/var/lib/mysql/systemctl start mysqld. service // start the mysql database service
3. log on
Mysql-uroot-p
4. Change the password
Use mysql; update user set authentication_string = password ('your password') where host = 'localhost' and user = 'mysql'; quit;
5. Log On again with the password
Mysql-uroot-p
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.