[Happy] code on a Windows environment using the mysql database (B) skip-grant-tables and user name password change

skip-grant-tables # skip verification database permissions

When we install MySql set my.ini configuration file, often adding skip-grant-tables in the my.ini, then access the database can use any account or password.

Here by the way, how [to reset the account password by skip-grant-tables]:

  • To find the root mysql mysql configuration file
  • Skip permission checks when you add a line in my.ini, [mysqld], so log on
  • If mysql service is running, stopped by the  net stop mysql service mysql stop

 

By re-  start the MySQL service net start mysql.

By  mysql -uroot -p login mysql, carriage return after the command prompt "Enter password", you can directly enter (because the database has permission to skip verified)

We can see the welcome screen and help information:

 

 

  • Change the root user's password through SQL statements (for example, set the root password is 12345678):
# Database is switched to the mysql 
mysql> the USE mysql ;
 # Change Password 
mysql> the UPDATE User the SET authentication_string = PASSWORD ( '12345678') the WHERE User = 'the root' ; 
# refresh related MySQL permission table mysql> the flush privileges ;
After # operation exit MySQL> exit ;

Guess you like

Origin www.cnblogs.com/mskx/p/11422310.html