我是你妈

编程就好跟打游戏一样,各种攻略,各种副本,各种各种,有意思!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

# /etc/init.d/mysql stop  或者 service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart  或者 service mysqld start
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>

 

支持远程访问:http://blog.csdn.net/sun614345456/article/details/53672150

mysql -uroot -p
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES; 
service mysqld restart
posted on 2017-09-03 20:21  杜兰德  阅读(4053)  评论(0编辑  收藏  举报