Skip navigation links

MySQL Forums :: Newbie :: Re-create root user


Advanced Search

Re-create root user
Posted by: Navid Shaikh ()
Date: October 11, 2012 08:56AM

Hi folks,
I am a newbie to mysql.

I had 'root'@'localhost' all ready.(I have created it at installation time)

I created 'root'@'%' also.

when I selected host,user from mysql.user it showed me two roots.
+------+-----------+
| user | host |
+------+-----------+
| dump | % |
| root | % |
| root | localhost |
+------+-----------+

I deleted the 'root'@'localhost'.

Now mysql.user table have 'root'@'%'.

mysql> select user, host from user;
+------+------+
| user | host |
+------+------+
| dump | % |
| root | % |
+------+------+

then I cam out of mysql prompt.

Tried reconnecting as a root, I am getting the error:

$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root@%'@'localhost' (using password: YES)
----------------------------------------------------------------------
I also tried restartig mysqld.service as
$ systemctl restart mysqld.service
yet I am getting the same error.

Please show me, why its happening?

Thank you.

Options: ReplyQuote


Subject Written By Posted
Re-create root user Navid Shaikh 10/11/2012 08:56AM
Re: Re-create root user Peter Brawley 10/11/2012 11:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.