How to set root password to null(如何将root密码设置为空)
问题描述
如何将 MySQL 的 root
用户的密码更改为 null
-- 意味着没有密码或 ''
-- 从 MySQL命令行客户端?
How can I change the password for root
user of MySQL to null
-- meaning no password or ''
-- from the MySQL command line client?
推荐答案
您可以通过以下五个简单的步骤恢复 MySQL 数据库服务器密码.
You can recover MySQL database server password with following five easy steps.
第 1 步:停止 MySQL 服务器进程.
Step # 1: Stop the MySQL server process.
第 2 步:使用 --skip-grant-tables 选项启动 MySQL (mysqld) 服务器/守护进程,这样它就不会提示输入密码.
Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.
第 3 步:以 root 用户身份连接到 mysql 服务器.
Step # 3: Connect to mysql server as the root user.
第 4 步:设置新的 mysql root 帐户密码,即重置 mysql 密码.
Step # 4: Setup new mysql root account password i.e. reset mysql password.
第 5 步:退出并重新启动 MySQL 服务器.
Step # 5: Exit and restart the MySQL server.
以下是您需要为每个步骤键入的命令(以 root 用户身份登录):
Here are commands you need to type for each step (login as the root user):
第一步:停止mysql服务
输出:
第 2 步:在没有密码的情况下启动 MySQL 服务器:
Step # 2: Start to MySQL server w/o password:
输出:
第 3 步:使用 mysql 客户端连接到 mysql 服务器:
Step # 3: Connect to mysql server using mysql client:
输出:
第 4 步:设置新的 MySQL 根用户密码
Step # 4: Setup new MySQL root user password
第 5 步:停止 MySQL 服务器:
Step # 5: Stop MySQL Server:
输出:
第 6 步:启动 MySQL 服务器并对其进行测试
Step # 6: Start MySQL server and test it
来源:http://www.cyberciti.biz/tips/恢复-mysql-root-password.html
这篇关于如何将root密码设置为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!