资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Mysql密码重置方法介绍

本文主要给大家介绍MySQL密码重置方法,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下Mysql密码重置方法吧。 

10年积累的成都网站设计、网站制作经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先制作网站后付款的网站建设流程,更有察哈尔右翼后免费网站建设让你可以放心的选择与我们合作。

  • Step # 1: Stop the MySQL server process.
  • Step # 2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password.
  • Step # 3: Connect to mysql server as the root user.
  • Step # 4: Setup new mysql root account password i.e. reset mysql password.
  • Step # 5: Exit and restart the MySQL server.

ok,五步,开始!

Step # 1 : 停止sql服务

/etc/init.d/mysql stop

输出 Stopping MySQL database server: mysqld.

Step # 2: 启动mysql服务镜像

mysqld_safe --skip-grant-tables &

输出
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe

Step # 3: 以mysql服务的方式去链接数据库

mysql -u root

输出显示
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

Step # 4: 为root用户设置新的密码

mysql> use mysql;
mysql> update user set password=PASSWORD("你的密码") where User='root';
mysql> flush privileges;
mysql> quit

Step # 5: 启动mysql服务

/etc/init.d/mysql stop

Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+  Done                    mysqld_safe --skip-grant-tables

Step # 6: 验证

 /etc/init.d/mysql start
 mysql -u root -p

输入这条命令按enter键后再输入密码,就能进去数据库啦!

reference:
https://www.cyberciti.biz/tips/recover-mysql-root-password.html

看完以上关于Mysql密码重置方法,很多读者朋友肯定多少有一定的了解,如需获取更多的行业知识信息 ,可以持续关注我们的行业资讯栏目的。


分享文章:Mysql密码重置方法介绍
本文网址:http://cdkjz.cn/article/jhhppp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220