0

I did an upgrade from 10.04 to 12.04 today. I wanted to access MySQL afterwards, but I've forgot the root password... So I tried some guides from the net but none is working for me. Im not even sure which MySQL-Version is installed right now:

root:~# apt-cache show mysql-server | grep Version
Version: 5.5.38-0ubuntu0.12.04.1
Version: 5.5.22-0ubuntu1

root:~# dpkg-reconfigure mysql-server-5.5 <- Did not work - server not installed. But it is working fine...

Who can help?

1 Answers1

1

http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html

  1. Stop mysqld and restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.
  2. Connect to the mysqld server with this command: mysql
  3. Issue the following statements in the mysql client. Replace the password with the password that you want to use. UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;
ceejayoz
  • 32,910
  • 7
  • 82
  • 106