Plugin 'FEDERATED' is disabled. mysqld: Table 'mysql.plugin' doesn't exist [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
发现bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql,但是我还没创建 /etc/my.cnf
那就重新创建:
[client]
default-character-set = utf8
port = 3306
socket = /usr/local/mysql/mysql.sock
[mysql]
default-character-set = utf8
[mysqld]
skip-name-resolve
basedir = /usr/local/mysql
datadir = /mysqlData/data
port = 3306
server_id = 10
socket = /usr/local/mysql/mysql.sock
character-set-server = utf8
max_connections = 200
default-storage-engine = INNODB
log-bin=mysql-bin
然后重新初始化
chmod +x /etc/init.d/mysqld
rm -rf /mysqlData/data/*
mysqld --defaults-file=/usr/local/mysql/my.cnf --explicit_defaults_for_timestamp --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysqlData/data/
service mysqld start
修改密码
alter user 'root'@'localhost' identified by '123456';
参考:https://www.cnblogs.com/yangchunlong/p/8465805.html