The installation steps are:
1. Since MySQL rpm has been removed from CentOS 7, it is necessary to download the RPM on its official website, and after downloading, use the following command to install the MySQL rpm configuration.
RPM-IVH *****[Note: * For RPM file name]
2. After installing RPM, use the following command to install.
Yum Install Mysql-community-server
3. After the installation is complete, use the following command to restart the MySQL service.
Systemctl Restart Mysqld.service
4. Then enter the command at the command terminal to enter the MySQL command line interface.
Mysql-u Root
At this time, however, the error is generally reported: Access denied for user ' root ' @ ' localhost ' (using Password:no), as shown in:
Prompt, you must enter a password in order to enter.
During the installation, MySQL generates a random password for the current installation account and is stored in the log, so you can find the password generated at the time of installation in the log using the following command.
sudo grep ' Temporary password ' /var/log/mysqld.log
After the password is queried, use the following command to enter the password entry and enter the MySQL command line environment after entering the correct password.
Mysql-u root-p
5. After entering the environment, the following configuration should be completed:
Change Password:
Use commands First
' %password% ';
To view the password policy for MySQL:
Then, use the following command to modify the password.
for [Email Protected]=password ('##############');
Allow root remote login:
First switch to the MySQL database and use the command below to allow the root account to log in remotely.
Update user set host='%' where user='root';
To modify the MySQL character set:
Using tools such as VI or GEDIT, open the /etc/my.cnf file and add a line of code under the [Mysqld] line:
Character_set_server=utf8
After saving, restart the MySQL service:
Systemctl Restart Mysqld.servcie
If CentOS 7 is a database server, you can also use the following command to have MySQL boot up with the system.
Systemctl Enable Mysqld.service
After restarting, use the following command to view the character set usage for MySQL.
' %character% ';
At this point, in the Centso 7 environment, the MySQL installation configuration is complete. Clients can connect using tools such as Navicat, which can be successfully connected.
Centos 7 Installation MySQL 5.7