Documenting Problems That Were Difficult To Find The Answer To

Help! I Created A New User In PhpMyAdmin But Cannot Log In That User

I downloaded the latest phpMyAdmin (v4.1.2). I installed MySQL v5.5.34-0ubuntu0.12.04.1.

I proceeded to create a user with no global privileges and privileges on a single database.

Then I tried to log in from the command line using my new user and password (in this case the user was phpmyadmin and the password was also phpmyadmin):

user@host:~$ mysql -u phpmyadmin phpmyadmin --password=phpmyadmin
ERROR 1045 (28000): Access denied for user 'phpmyadmin'@'localhost' (using pasword: YES)

It turned out that I needed to use the PASSWORD function in MySQL itself to create the password rather than relying on phpMyAdmin’s password generation function.

user@host:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 97
Server version: 5.5.34-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;

Database changed
mysql> update user set password=PASSWORD('phpmyadmin') where user = 'phpmyadmin';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> \q

After this I could log in as user phpmyadmin with password phpmyadmin!

If that didn’t work then, with MariaDB, I was forced to run (for user dbuser authorised to access mydb):

GRANT ALL PRIVILEGES ON mydb TO 'dbuser'@'%' IDENTIFIED BY 'dbpass';

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: