Mysql启报错报The server quit without updating PID file
查看日志文件:
Plugin 'InnoDB' registration as a STORAGE ENGINE failed
原因 datadir 目录没有权限,是root生成的,chown -R mysql:mysql /datadir 即可
接着启动服务依然报错
查看日志:
Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
解决方案:
vim /etc/my.cnf
basedir = /usr/local/mysql
datadir = /data/mysql
socket = /tmp/mysql.sock
log-error = /data/mysql/error.log
pid-file = /data/mysql/mysql.pid
user = mysql
tmpdir = /tmp
./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
再启动就可以了
密码无限提示已过期,每次刚生成的密码登录就提示这个错误
解决方法:
./mydqld --skip-grant-tables 启动服务
打开另外一个终端, mysql -u root 直接登录进mysql
use mysql;
update user set password_expired='N';
update user set authentication_string=password("123456") where user="root";
flush privileges;
quit;
搞定!
password_expired 密码是否过期的字段