MySQL 常见问题
重置密码
关闭mysql服务sudo /etc/init.d/mysql stop
用mysql安全模式运行并跳过权限验证sudo mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
用空密码方式使用root用户登录 mysqlsudo mysql -u root mysql
更新密码update user set Password = PASSWORD('root') where User ='root';
update mysql.user set authentication_string=password('root') where user='root' ;
刷新权限FLUSH PRIVILEGES;
退出quit
密码过于简单。 (5.7以上需要重置密码 ) 8位,大小写字母,特殊符号You must reset your password using ALTER USER statement before executing this statement
进去mysql配置项vim /etc/my.cnf
跳过验证[mysqld]
添加skip-grant-tables
修改密码alter user 'root'@'localhost' identified by '#20as3SElksds0ew98';
刷新权限FLUSH PRIVILEGES;
本作品采用《CC 协议》,转载必须注明作者和本文链接