One, MySQL installation
See if MySQL is installed
Rpm-qa | grep mysql-server
Yum Install Mysql-server
Modifying a configuration file
Vim/etc/my.cnf
Set up system service startup
Chkconfig mysqld on
View settings Status
Chkconfig--list mysqld
Start MySQL
Service MySQL Restart
(Start stop)
If it fails to start, start with the following command
/etc/rc.d/init.d/mysqld start
Second, the question
View Mysqld's log file
Less/var/log/mysqld.log
(1) Mysql.sock does not exist links---> https://www.linuxidc.com/Linux/2009-09/21897.htm
Solution:
/etc/init.d/mysqld stop
1 $/usr/local/bin/mysql_install_db //Rebuild Authorization Form 3 $/usr/local/bin/mysqld_safe &
/etc/init.d/mysqld start
Log in to MySQL
# MySQL
(2) Access denied for user ' root ' @ ' localhost
#/etc/rc.d/init.d/mysql Stop
# Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
# mysql-u Root MySQL
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
mysql> FLUSH privileges;
Mysql> quit
#/etc/init.d/mysql Restart
# mysql-uroot-p
Enter Password: < Enter the newly set password newpassword>
Mysql>
Linux--mysql