top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Access denied for user 'root'@'localhost' (using password: YES) on mysql admin

+2 votes

I have installed mysql admin on my local environment and I am able to connect to mysql through command line.

But in the browser I get the error :

Access denied for user 'root'@'localhost' (using password: YES)

I can't find any information in error log and access log. Is there any command parameter that I should use when starting mysql so this doesn't happen ?

I am starting it this way :

sudo ./mysql.server start

my /etc/hosts file :

# Host Database
# localhost broadcasthost
::1 localhost xxxx.local mysqld
posted Jan 13, 2014 by Satish Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Are you using "localhost" or "" in the web-application
root@localhost != root@ = different users

1 Answer

+1 vote

From that error I would suspect you are trying to access to a database where has not external access. And yeah, try by doing

$> mysql -u root -p  -h localhost -P 3306

change localhost by in order to test if both cases work, and see which of them (localhost/ is defined in your web app as you've been told in the mail before.

answer Jan 13, 2014 by Ahmed Patel
Similar Questions
+1 vote

Is there a way to make python script that connects to mySQL DB ask for a password on the:

conn = mdb.connect(host, user)
+1 vote

To start MySQL in safe mode, mysqld_safe command is used which allow it to run in the safe mode and it also doesn’t allow the reading of tables with the database passwords:

[root@ ]# mysqld_safe --skip-grant-tables --skip-networking &[1] 13007
[root@ ]# Starting mysqld daemon with databases from /var/lib/mysql
[root@ ]#

After running the MySQL in safe mode the password protection gets removed and to use the password protection mechanism a command is used as follows:

mysql -u root command
[root@bigboy tmp]# mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.16
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> [ a message is being shown which allow user to take the control of the root]

Now the question is how can I change root password in safe mode?

+2 votes

In my web application I need to encrypt the database password and and that should be stored in the properties file?

0 votes

I am having trouble to transfer email user account which is saved in MySQL to another server. Here is the detail:

I have an old email server which using MySQL to store user account information. The password field uses MySQL ENCRYPT function to save the users password. So if I want change the user's password I can do:
UPDATE mail.users SET password = ENCRYPT( '12345' ) WHERE CONVERT( USING utf8 ) = '' LIMIT 1 ;

Then the new password "12345" saved in the table as string of "2I6JOeg.JukJ."

Now I build a new server using iRedMail. When I try to transfer user account I have trouble to transfer the password field. Because the iRadMail/dovecot is using MD5-CRAM to encrypt the password then save it
in the MySQL. All the password string is started with "$1$".

So, is there a way to make the MySQL encrypted password string "2I6JOeg.JukJ." convert to MD5 hash "$1$................."?

0 votes

Is it possible to connect database with c code, if yes then how?

If possible share the sample code for connecting to a MySQL database and run a sample query....

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.