您的位置:首页 > 数据库 > MySQL

修改mysql密码

2016-07-20 13:05 381 查看
mysqld_safe --skip-grant-tables &

sudo /usr/local/mysql/bin/mysqld_safe –user=root & 
sudo /usr/local/mysql/bin/mysqladmin -uroot password yourpassword
update mysql.user set password=‘’ whereUser='root'; 
flush privileges; 
quit
authentication_string
sudo /usr/local/mysql/support-files/mysql.server start
1.  停止 mysql server.  通常是在 '系统偏好设置' > MySQL > 'Stop MySQL Server'
2.  打开终端,输入:
 sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
3.  打开另一个新终端,输入:
 sudo /usr/local/mysql/bin/mysql -u root
UPDATE mysql.user SET authentication_string=PASSWORD('新密码') WHERE User='root';
FLUSH PRIVILEGES;

4.  重启MySQL.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: