当前位置:网站首页>MySQL forgot how to change the password

MySQL forgot how to change the password

2022-07-07 04:29:00 Programmer community


stay windows Next :
Open the command line window , stop it mysql service :

net stop mysql

 

To mysql The installation path of mysql, stay bin Execute the command to start under the directory

mysqld --skip-grant-tables

Copy the command to the command line .

Then open the MySql, perform mysql, At this time, you can enter without entering a password .

use mysql update user set password=password(" New password ") where user="root"; flush privileges; exit

Use Task Manager , find mysqld-nt The process of , The end of the process !
It's restarting mysql-nt service , You can log in with your new password .

net start mysql

 

stay linux Next :
If MySQL Running , First of all, kill it

 

You can do that :
Stop database service
To the database installation directory , find my.ini , Open to find

[mysqld]  Replace with  [mysqld skip-grant-tables]

Start database service
Access to the database is no longer restricted

 

MySql Forget the password How to modify illustrations

I recommend you to read more about “ mysql password To configure my.ini The server ” The article

原网站

版权声明
本文为[Programmer community]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130800182467.html

随机推荐