Это старая версия документа.


Reset MySQL Password On Ubuntu 06.19.2011 Email inShare Views: 1863

  0
  inShare
  submit to reddit 
      Check if MySQL is running. (display all sockets with TCP protocol, show program name for them)

view source print? 1.netstat -tap | grep mysql

Stop MySQL:

view source print? 1.sudo stop mysql

or

view source print? 1.sudo /etc/init.d/mysql stop

Start MySQL server so that everyone could connect without a password and with all privileges (+ prevent remote clients from connecting for security reasons):

view source print? 1.sudo mysqld –skip-grant-tables –skip-networking

In another shell tab connect to MySQL without password

view source print? 1.mysql

Update passwords in the MySQL:

view source print? 1.mysql> update mysql.user set password = password('your_new_password') where user = 'root'; 2.mysql> flush privileges;

Stop the MySQL server:

view source print? 1.sudo mysqladmin shutdown

Start normally:

view source print? 1.sudo start mysql

Connect normally:

view source print? 1.mysql -u root -p