MySQL forgot password How to log in?

Source: Internet
Author: User

MySQL forgot password How to log in?

Method 1:

1,可以在配置文件里加上 skip-grant-tables   

Method 2:

再MySQL没启动的情况下[[email protected] ~]# mysqld_safe --skip-grant-tables &  --用这命令启动再可直接登陆就不用密码了,进去后就可以修改密码如出现找不到命令的报错  -bash: mysqld_safe:command not found进入mysql目录:cd /usr/local/mysql/  (我这是源码包安装的)再运行: bin/mysqld_safe --skip-grant-tables &

Three ways to change your password

mysqladmin -u root password ‘456‘ -p123 --明文方式修改密码,就需要原密码(456是新密码,原密码是123)mysqladmin -u root password  -p     --不想明文方式修改密码 Enter password:         --隐藏输入原密码 New password:           --隐藏输入新密码 Confirm new password:       

The second type:

进入数据库内修改密码 1、update mysql.user set password=password("789") where user="root" and host="localhost";    

The third type:

MySQL forgot password How to log in?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.