Installing mysql using yum saves many steps for installing the source code package, but sometimes the mysql service cannot be started after mysqlyum is packaged and started,
Installing mysql using yum saves many steps for installing the source code package, but sometimes the problem that mysql cannot be started when mysql service is started after mysql yum is packaged,
Installing mysql using yum saves many steps for installing the source code package, but sometimes the problem that mysql cannot be started when mysql service is started after yum is packaged with mysql is reported as follows: can't connect to local MySQL server through socket '/tmp/mysql. sock '(2), mysql cannot be found. sock file, mysql. the sock file appears after mysql is installed and the database is initialized. Therefore, after installing the package, perform the following steps:
Add the mysqld service.
/Sbin/chkconfig -- add mysqld [add mysql service to service list]
Start mysql.
Service mysqld start; (that is,/etc/init. d/mysqld start. You can also set it to boot automatically:/sbin/chkconfig mysqld on)
Then, the amount... What if "MySQL Daemon failed to start" is displayed? This is the solution.
1. initialize the database
/Usr/bin/mysql_install_db -- user = mysql
Cp/usr/share/mysql/my-small.cnf/etc/my. cnf (optional)
2. log on to mysql in safe Mode
Cd/usr;
/Usr/bin/mysqld_safe &
3. Restart the mysqld service.