I have a MySQL installed on my linux server, I forgot it\'s password so I went and changed it using the methods I found on the web. What I did was as follows:
In my case:
(in new window)
You may need to clear the plugin
column for your root account. On my fresh install, all of the root user accounts had unix_socket
set in the plugin
column. This was causing the root sql account to be locked only to the root unix account, since only system root could login via socket.
If you update user set plugin='' where User='root';flush privileges;
, you should now be able to login to the root account from any localhost unix account (with a password).
See this AskUbuntu question and answer for more details.
You have to reset the password! steps for mac osx(tested and working) and ubuntu
Stop MySQL
$ sudo /usr/local/mysql/support-files/mysql.server stop
Start it in safe mode:
$ sudo mysqld_safe --skip-grant-tables
(above line is the whole command)
This will be an ongoing command until the process is finished so open another shell/terminal window, log in without a password:
$ mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server start
your new password is 'password'.
I was able to solve this problem by executing this statement
sudo dpkg-reconfigure mysql-server-5.5
Which will change the root password.
Actually I took a closer look at the user table in mysql database, turns out someone prior to me edited the ssl_type field for user root to SSL.
I edited that field and restarted mysql and it worked like a charm.
Thanks.
You can try this solution :-
To have mysql asking you for a password, you also need to specify the -p-option: (try with space between -p and password)
mysql -u root -p new_password
MySQLl access denied
In the Second link someone has commented the same problem.