MySQL—— How to reset the root password

淡淡的烟草味﹌ 2022-03-21 11:46 222阅读 0赞
Steps to change password when you have forgotten:
1. Stop MySQL Server
  1. /etc/init.d/mysql stop
2. Start the database without loading the grant tables or enabling networking:
  1. mysqld_safe --skip-grant-tables &
  2. mysql -u root
3. Setup new MySQL root user password
  1. use mysql;
  2. update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
  3. flush privileges;
  4. quit;
4. Stop MySQL Server:
  1. /etc/init.d/mysql stop
5. Start MySQL server and test it
  1. mysql -u root -p
OK, That’s all.

发表评论

表情:
评论列表 (有 0 条评论,222人围观)

还没有评论,来说两句吧...

相关阅读

    相关 How to verify the peer socket is dead?

    对于`TCP/IP`网络编程而言,我们在读写数据时,当然希望获知对端是否还活着!量子纠缠态当然很是理想,但是现实网络世界中,两个不可见端点互相通讯,确定对方还活着的方法就是不断