-1

I know the title looks familiar but no. I was working on a web app, and when I ran it, it says: Access denied for user 'root'@'localhost' (using password: NO). I searched some sites and they said that I should use a password. So I changed the password using mysql console. Than I got this message Access denied for user 'root'@'localhost' (using password: YES). And when I reenter the mysql console and put the password it makes a beep than it is closed. I got this event log:

Log Name:      Application

Source: .NET Runtime Date: 10/18/2015 7:12:51 PM Event ID: 1026 Task Category: None Level: Error Keywords: Classic User: N/A Computer: TOSHIBA-TOSH Description: Application: MySQLWorkbench.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.Remoting.RemotingException Stack: at System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.StartListening(System.Object) at MySQL.Workbench.ApplicationInstanceManager.RegisterRemoteType(System.String) at MySQL.Workbench.ApplicationInstanceManager.CreateSingleInstance(System.String, System.String[], System.EventHandler`1)
at MySQL.GUI.Workbench.Program.Main(System.String[])

Event Xml:
1026 2 0 0x80000000000000 537897 Application TOSHIBA-TOSH Application: MySQLWorkbench.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.Remoting.RemotingException Stack: at System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.StartListening(System.Object) at MySQL.Workbench.ApplicationInstanceManager.RegisterRemoteType(System.String) at MySQL.Workbench.ApplicationInstanceManager.CreateSingleInstance(System.String, System.String[], System.EventHandler`1<MySQL.Workbench.InstanceCallbackEventArgs>) at MySQL.GUI.Workbench.Program.Main(System.String[])

Any help ? I uninstalled everything (wamp, mysql, dreamweaver,.........) but still got the same problem. And mysql workbench give this error when i enter the password This error.

I tried to use config.inc.php solutions but still the same.

13
  • The password you are entering is wrong. How did you change it? Can we see the command you used? Commented Oct 19, 2015 at 6:17
  • in the config.inc.php I put it as "root" and in mysql console I used: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root'); Commented Oct 19, 2015 at 6:21
  • Are you able to access phpmyadmin using above user and password? Commented Oct 19, 2015 at 6:22
  • Nope, I got this in localhost/phpmyadmin :#1045 - Access denied for user 'root'@'localhost' (using password: YES) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. Commented Oct 19, 2015 at 6:24
  • are you able to connect mysql from server console by root or any other admin user.... Commented Oct 19, 2015 at 6:27

2 Answers 2

1

Please follow below steps:

Go to mysql server console and follow below steps:

Step1: open your config file and add below lines in [mysqld] section and save file.

skip-grant-tables
skip-networking

Step2: Restart your mysql service, you can use below command if using linux.

service mysqld restart 

Step3: Now connect mysql by below command-

mysql -uroot

Step4: Above command will connect you with mysql and will show mysql prompt like below-

mysql>

Step5: Now change root password as per below-

mysql> update mysql.user set password = password('root123') where user='root';
OR 
mysql> update mysql.user set password = password('root123') where user='root' and host = 'localhost';

mysql> flush privileges;

mysql> exit;

Step6: Now remove newly added lines from config file and restart mysql service again as per step2.

Finally now you can connect your web or phpmyadmin with root user.

Sign up to request clarification or add additional context in comments.

4 Comments

I did exactly what you asked me to do in the 6 steps. But still got the error when I am using phpmyadmin: MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: YES) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
now r u able to connect mysql from mysql server consol
no, but i uninstalled everything and reinstall and now it works.
Depending on your phpMyAdmin config, it uses a password hard coded in the phpmyadmin config.inc.php file. When you change the root password in MYSQL, you then have to amend the password that phpMyAdmin will try and use. PS There are better configs for phpMyAdmin that will make phpMyAdmin throw a login page so you can enter the username and password manually
0

Maybe root from localhost has not the required grant to access the DB.

Try to run the following on a mysql console:

GRANT ALL ON <yourdb>.* TO 'root'@'localhost';
FLUSH PRIVILEGES;

5 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
And what I just did wrong ? Just answer my post question and stop criticizing the way I make comment @BFDatabaseAdmin
@droidnation - Firstly, that's a standard reply that's generated by the review cue because this answer was flagged as potentially low quality. Secondly, it's not even directed at you, it's directed at the answerer, as this isn't a full answer. Thirdly, manners, please.
@BFDatabaseAdmin I could not comment on the original post. I posted the reply because I was quite sure that was the problem.
@LucaTruffarelli the problem is that mysql console make a beep sound and shut down immediately when i put the password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.