These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for DBI connect failed : Access denied for user ''@'localhost' to database 'mysql' on the new forum.
Hi Forum,
I've mistakenly changed MYSQL root user name from "root" to "xyz" using COMMAND :
update mysql.user set user='xyz' where user='root'; flush privileges;
But after exiting from MySql when I tried to reopen command prompt of MySql I could not enter using the previous password and whenevr I was trying to use mysql database it was showing : Access denied for user ''@'localhost' to database 'mysql'
I have also tried with changing root password and finally reinstalled the mysql but same thing is happening till now.
Till now using Command :
select user(),current_user(); I am getting user - root@localhost and current_user - ''@localhost
Please help me in that so that I can connect mysql and proceed with my work.
Thanks in advance
Rajhrita
Howdy,
Are you able to connect to MySQL using something like this from the command line:
mysql -u xyz -p
If so, then you should have root privileges when you connect, which would allow you to correct your root username.
-Eric