• notice
  • Congratulations on the launch of the Sought Tech site

Linuxmysql retrieves password

1.Stop to the running mysql:/etc/init.d/mysql stop

2.Use the option skip-grant-tables to start MySQL:/usr/bin/mysqld_safe--skip-grant-tables &

3.Now you can enter mysql without a password.

# myql

> use mysql;

> UPDATE user SET password=password('123456') WHERE user='root';//Change the password to 123456;

> FLUSH PRIVILEGES;

> quit;//Quit mysql

4.Restart mysql:/etc/init.d/mysql restart

You can now log in with mysql-uroot-p123456.



This article comes from the CSDN blog, please indicate the source for reprinting: http://blog.csdn.net/ytz_linuxer/archive/2009/07/03/4320660.aspx

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+