1. First check whether the system has mysql installed rpm -qa | grep mysql 2. Download the mysql repo source (5.7) wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm If the error is: -bash: wget: command not found Install the plugin 3. Install sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm 4. Install MySQL sudo yum install mysql-server 5. Reset MySQL password Check the running status of MySQL, as shown in the figure: systemctl status mysqld.service At this point, MySQL has started running normally, but to enter MySQL, you must first find out the password of the root user. You can find the password in the log file using the following command: grep "password" /var/log/mysqld.log Enter the database using the following command: mysql -uroot -p Enter the initial password (Es9akjRtrd<4 at the end of the picture above). You cannot do anything at this time because MySQL requires you to change the password before you can operate the database: ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'; Replace 'new password' with the password you want to set. Note: The password must contain uppercase and lowercase letters, numbers, and special symbols (,/';:, etc.), otherwise the configuration will fail. 6. Restart MySQL service service mysqld restart Then set the remote connection password for the Root account. Both the account and password are root. mysql -u root -p GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY " your password "; Restart the server service mysqld restart 7. Use external network tools to connect to MySQL The username and password to connect to mysql are both root Turn off firewall systemctl stop firewalld.service This is the end of this article about installing MySql on CentOS7.5. For more information about installing MySql on CentOS7.5, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Let's learn about JavaScript object-oriented
>>: How to use MySQL group by and order by together
1. Inner Join Query Overview Inner join is a very...
This article shares the specific code of the js n...
1. Concept They are all attributes of Element, in...
Uninstall MySQL 1. In the control panel, uninstal...
Introduction to Load Balancing Before introducing...
On many websites, we have seen the input box disp...
Win10 installation (skip if already installed) Fo...
When using docker images, images with both REPOSI...
0x0 Test Environment The headquarters production ...
This article example shares the specific code for...
The difference between CSS3 animation and JS anim...
In the course of work, you will encounter many ca...
Recently, students from the User Experience Team o...
Recently, when I turned on my computer, I saw tha...
Generally, click events will be divided into diff...