0
votes

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.

2
The password you are entering is wrong. How did you change it? Can we see the command you used? - michelem
in the config.inc.php I put it as "root" and in mysql console I used: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root'); - alim1990
Are you able to access phpmyadmin using above user and password? - Altmish-E-Azam
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. - alim1990
are you able to connect mysql from server console by root or any other admin user.... - Zafar Malik

2 Answers

1
votes

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.

0
votes

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;