Home >Database >Mysql Tutorial >修改MySQL的root密码 (Linux环境)_MySQL

修改MySQL的root密码 (Linux环境)_MySQL

WBOY
WBOYOriginal
2016-06-01 13:57:17892browse

   第一种方法:
root用户登录系统

/usr/local/mysql/bin/mysqladmin -u root -p password 新密码

enter password 旧密码

第二种方法:

root用户登录mysql数据库

mysql> update mysql.user set password=password(”新密码”)where User=”root”;

mysql> flush privileges;

mysql> quit ;

mysql忘记root密码如何处理?

如果 MySQL 正在运行,首先结束mysql进程: killall mysqld

启动 MySQL (非正常方式起动):/usr/local/mysql/bin/mysqld_safe

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