1. Download and install the official MySQL Yum Repository wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm The rpm file will be generated in the current directory 2. Install using yum yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server After waiting for a while, MySQL will be installed, followed by some settings for MySQL. 3. Change the root password After successful installation, a root user will be created by default with an initial password. You need to change the initial password and start mysql systemctl start mysqld.service Find the initial password in the MySQL log. The command is as follows grep "password" /var/log/mysqld.log Enter the database using the following command mysql -uroot -p Execute the change password command in the mysql client connection environment ALTER USER 'root'@'localhost' IDENTIFIED BY 'new@password'; At this point the password has been changed successfully, restart the mysql service systemctl restart mysqld.service 4. Change the character set to UTF-8 Enter MySQL through the command mysql -uroot -p. Note that it is a new password. In the MySQL environment, use the following command to view the character set. show variables like '%character%'; We can see that the character sets above are not all utf-8. Now we open the mysql configuration file in the bash terminal. vi /etc/my.cnf Add the following configuration items according to actual situation #add by tangxiaobai character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8 Restart the server and check whether the character set has been modified successfully. We see that the character set has been modified successfully 5. Set up MySQL to support remote connection So far, our Mysql cannot be accessed remotely. Here we use the table method, log in to the mysql command client, and execute the following command use mysql; update user set host = '%' where user = 'root'; Restart the Mysql service and test it with the client connection tool We see that the mysql connection test is successful. But there is still a problem at this time, that is, because the Yum Repository is installed, each subsequent yum operation will automatically update, so you need to uninstall it: yum -y remove mysql57-community-release-el7-10.noarch The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: React tips teach you how to get rid of hooks dependency troubles
>>: Complete steps for Nginx to configure anti-hotlinking
Table of contents 1. Database Engine 1.1 View dat...
Table of contents 1. Install Docker 2. Install an...
1. Use frameset, frame and iframe to realize mult...
Table of contents Introduction to frm files and i...
How to add css in html? There are three ways to s...
Table of contents Preface 1. Get the length of a ...
Table of contents 1. Scope 2. Function return val...
p>Manually start in "Services" and i...
Disabling and enabling MySQL foreign key constrai...
Table of contents Introduction Mirror repository ...
Win2008 R2 zip format mysql installation and conf...
This article example shares the specific code of ...
This article shares the specific code of the WeCh...
When a website is maliciously requested, blacklis...
Colleagues often ask, when deleting files/directo...