[[email protected] ~]# systemctl start mysqld start failed
Job for Mysqld.service failed because the control process exited with error code. See "Systemctl Status Mysqld.service" and "Journalctl-xe" for details.
To view the System log error:
May 19:04:53 localhost mysqld:2018-05-29t11:04:53.723812z 0 [ERROR] innodb:the innodb_system data file ' ibdata1 ' must Be writable
May 19:04:53 localhost mysqld:2018-05-29t11:04:53.723862z 0 [ERROR] innodb:the innodb_system data file ' ibdata1 ' must Be writable
19:04:53 localhost mysqld:2018-05-29t11:04:53.723871z 0 [ERROR] innodb:plugin initialization aborted with error G Eneric Error
May 19:04:54 localhost mysqld:2018-05-29t11:04:54.325440z 0 [ERROR] Plugin ' InnoDB ' init function returned ERROR.
May 19:04:54 localhost mysqld:2018-05-29t11:04:54.325475z 0 [ERROR] Plugin ' InnoDB ' registration as a STORAGE ENGINE f Ailed.
May 19:04:54 localhost mysqld:2018-05-29t11:04:54.325483z 0 [ERROR] Failed to initialize builtin plugins.
May 19:04:54 localhost mysqld:2018-05-29t11:04:54.325485z 0 [ERROR] aborting
The cause of the error is roughly: Your data file is not writable
Cause: The owner of the Yum installed MySQL is root, and MySQL requires the identity to be MySQL, and the permissions issue causes the data file to be non-writable
Here's how to fix it:
[Email protected] ~]# chown-r mysql/var/lib/mysql
[Email protected] ~]# systemctl start mysqld
[Email protected] ~]# Tailf/var/log/messages &
Log printing:
May 19:09:15 localhost mysqld:version: ' 5.7.22 ' socket: '/var/lib/mysql/mysql.sock ' port:3306 mysql Community Serv ER (GPL)
Startup success
Log in to MySQL, do not need a password at this time, directly enter:
# mysql-u Root-p
Change the root password to 123456:
mysql> use Mysql;> update user set Authentication_ String=password ( "123456" where User= ' root ' ;> flush Privileges;# refresh permissions, do not refresh the words may cause MySQL Enter directly will be logged on
Note The password field name of version 5.7 is authentication_string, which was previously password.
After the modification, remember to comment out the my.cnf in the skip-grant-tables parameter, restart the MySQL service, you can use the password you set to log in.
Centos7 Yum does not start up after installing MySQL.