mysql> ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement #输入 mysql> flush privileges;刷新配置 # 再次创建用户 mysql> create user 'root'@'localhost' identity by '123456';
再次报错,这步没报错的也是直接跳到赋予权限那一步,报错的以下操作:
1 2
mysql> drop user 'root'@'localhost'; mysql> create user 'root'@'localhost' identified by '123456';
4. 赋予root权限
1 2 3 4
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; #赋予所有库所有表操作权限 mysql> flush privileges; mysql>exit;
再次查询user表,会发现用户表新建了一个root用户
5. 修改配置文件
1 2 3 4 5 6 7
vim /etc/my.cnf ##删除配置 #skip-grant-table=1 ##保存并重启mysql service myqld restart