This article will introduce to you how to install MySQL5.6 using YUM under CentOS7. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
1 |
|
If a null value is returned, it means MySQL is not installed.
Note: In the new version of CentOS7, the default database has been updated to Mariadb instead of MySQL, so executing the yum install mysql command only updates the Mariadb database and does not install MySQL.
(2) Check the installed Mariadb database version.
1 |
|
# (3) Uninstall the installed Mariadb database.
1 |
|
(4) Check the installed Mariadb database version again to confirm whether the uninstallation is complete.
1 |
|
(5) Download the installation package file.
1 |
|
(6) Install the mysql-community-release-el7-5.noarch.rpm package
1 |
|
After the installation is completed, two yum source files, mysql-community.repo and mysql-community-source.repo, will be added to the /etc/yum.repos.d/ directory.
Execute the yum repolist all | grep mysql command to view the available mysql installation files.
(6) Install mysql.
1 |
|
(7) Check whether mysql is installed successfully.
1 |
|
(8) Start the mysql service.
1 2 3 4 |
|
Mysql common file path:
/etc/my.cnf This is the main configuration file of mysql
/var/lib/mysql mysql The database file storage location of the database
/var/logs/mysqld.log The database log output storage location
(9) Set the password.
After the installation of mysql5.6 is completed, the password of its root user is empty by default. We need to log in promptly with the root user of mysql (press enter directly for the first time without entering a password) and change the password.
1 2 3 4 |
|
(10) Set up remote host login
1 |
|
Execute the following command to add remote login capability to the root user.
1 |
|
[Recommended learning: SQL video tutorial]
The above is the detailed content of How to use YUM to install MySQL5.6 under CentOS7. For more information, please follow other related articles on the PHP Chinese website!