Difference between revisions of "Lost MySQL root password?"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  # mysqld_safe --skip-grant-tables &
/etc/init.d/mysql stop
 
  mysqld_safe --skip-grant-tables &
  [1] 2429
  [1] 2429
  morgui:~# Starting mysqld daemon with databases from /var/lib/mysql
  morgui:~# Starting mysqld daemon with databases from /var/lib/mysql
Line 10: Line 12:
  use mysql;
  use mysql;


  update user set password=PASSWORD("password") where user='root';
  update user set password=PASSWORD('''""''') where user='root';
 
Type your password there inside of those quotes, for example PASSWORD('''"my_new_password"''')


  flush privileges;
  flush privileges;
Line 20: Line 24:
  quit;
  quit;


  /etc/init.t/mysql restart
  /etc/init.d/mysql restart





Latest revision as of 10:58, 13 January 2010

/etc/init.d/mysql stop

mysqld_safe --skip-grant-tables &
[1] 2429
morgui:~# Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[2466]: started

Window hangs, we go to other console

mysql -u root
use mysql;
update user set password=PASSWORD("") where user='root';

Type your password there inside of those quotes, for example PASSWORD("my_new_password")

flush privileges;
quit;

Back to previous console:

quit;
/etc/init.d/mysql restart





http://www.debianhelp.co.uk/mysqlroot.htm