Home >Database >Mysql Tutorial >解决办法之MySQL忘记超级用户口令_MySQL

解决办法之MySQL忘记超级用户口令_MySQL

WBOY
WBOYOriginal
2016-06-01 14:11:47892browse

  如果MySQL正在运行,首先杀之: killall -TERM mysqld。
  
  启动MySQL:bin/safe_mysqld --skip-grant-tables &
  
  就可以不需要密码就进入MySQL了。
  
  然后就是
  
  >use mysql
  
  >update user set password=password("new_pass") where user="root";
  
  >flush privileges;
  
  重新杀MySQL,用正常方法启动MySQL 。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn