On CentOS, start MySQL with the command: Service mysqld restart
# service mysqld restart Stopping mysqld: [ OK ] MySQL Daemon failed to start. Starting mysqld: [FAILED]
Enter the MySQL related directory to view:
# cd /var/lib/mysql/ # ls hhw_global ibdata1 ib_logfile0 ib_logfile1 localhost.localdomain.err mysql mysql.sock test
To view the server startup log:
# tail localhost.localdomain.err 190610 20:16:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 190610 20:16:57 [ERROR] You need to use --log-bin to make --binlog-format work. 190610 20:16:57 [ERROR] Aborting 190610 20:16:57 [Note] /usr/libexec/mysqld: Shutdown complete 190610 20:16:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
As you can see, the two lines reported an error saying that the — binlog format option was turned on, but bin log was not turned on, so the MySQL process could not be started. Use the following command to view the location of the configuration:
# mysqld --verbose --help|grep -A 1 'Default options'
# mysql --verbose --help|grep -A 1 'Default options'
# mysql --verbose --help|grep -A 1 'Default options' Default options are read from the following files in the given order: /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
Find the corresponding my.cnf, modify the corresponding configuration item, and restart mysqld service
- How to Solve MYSQL error “no directory, logging in with home = -“
- [Solved] MYSQL ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mysql’
- Job for mysqld.service failed because the control process exited with error code
- [Solved] Libvirt startup error: failed to start virtualization daemon
- How to Solve MySQL Startup error: mysql-bin.index not found (Errcode: 13)
- MySQL he server quit without updating PID file [How to Solve]
- Solution to the error of MySQL: unrecognized service (CentOS)
- MySQL Error: the solution of command not found
- [Solved] Docker Starup Error: Failed to start Docker Application Container Engine.
- Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist