# xampp-MySQL-重置密码 1、停止mysql服务器 ``` sudo /opt/lampp/lampp stopmysql ``` 2、使用`--skip-grant-tables' 参数来启动 mysqld ``` sudo /opt/lampp/sbin/mysqld --skip-grant-tables ``` 3、再开一个终端(在终端中直接右键+B) 进入mysql ``` sudo /opt/lampp/bin/mysql -uroot ``` 现在会直接进入mysql 4、连接mysql权限数据库 ``` use mysql; ``` 5、修改root用户的密码 ``` update user set password=password("123456") where user="root"; ``` 6、刷新权限表(必须要有这一步) ``` flush privileges; ``` 7、退出mysql ``` quit; ``` 8、重启mysql服务 ``` sudo /opt/lampp/lampp startmysql ``` ok 现在就可以使用刚才设置的密码登录msql了 参考: http://www.cnblogs.com/abinxm/archive/2011/10/09/2204824.html http://www.cnblogs.com/ylqmf/archive/2011/12/29/2305730.html Last modification:August 15th, 2020 at 04:37 pm © 允许规范转载 Support 众筹催更 ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat