CentOS7 64-bit installation mysql graphic tutorial, centos7mysql
Prerequisites for installing mysql: CentOS 7 64-bit is installed, and CentOS 7 canConnect to the network
OpenTerminalCheck whether mysql is installed:
Enter
yum list installed | grep mysql
For example:
This shows that mysql has been installed. If mysql has been installed, uninstall it first and enter:
yum -y remove mysql-libs.x86_64
Delete an installed mysql instance
After deletion, enter:
yum install mysql-community-server
For example:
This means the installation is started. As long as the system can connect to the network, it will automatically download and install, and yum will automatically process the dependency between MySQL and other components.
During the automatic installation process, you are required to choose whether to continue downloading or not. Enter y and press enter, as shown in the following figure:
After the installation is complete and all dependencies that have been installed are prompted, for example:
This indicates that the installation is complete. I replaced it because I did not delete the installed mysql.
After the installation is complete, enter the following in the terminal:Systemctl start mysqld
Restart the mysql service, set the initial user name and password, and enter:Mysql_secure_installation
For example, after installation, the username is root, and the password is empty. Press enter when the password appears, for example:
Enter y and press Enter.
After that, you will be prompted to enter the new password for confirmation. Then, follow the prompts to enter y and press Enter.
After installing mysqlRemote AccessMySQL,Default port 3306 must be enabled.
Enter systemctl start mysqld in the terminal
Restart the mysql service and enter:
firewall-cmd –permanent –zone=public –add-port=3306/tcp firewall-cmd –permanent –zone=public –add-port=3306/udp
The two commands can open port 3306, for example:
When I run the yum command, I see:/var/run/yum. pid has been locked and another program whose PID is xxxx is running. If this occurs
rm -f /var/run/yum.pid
Run yum again after deleting the file.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.