how to create new user for phpmyadmin login

PHPMyAdmin and MySQL server complement each other very well. In most situations you have installed mysql server and phpmyadmin.

By default the mysql root password is blank and this is a big security issue and you have change the mysql password as soon as possible. If that is not done anybody could login with phpmyadmin with username root and password blank. You also must avoid to login phpmyadmin with mysql root password. Instead you must create a new user (to phpmyadmin) with same privileges as mysql root.

First change the mysql root password

mysql > update user set password=password('XXXXX') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql > FLUSH PRIVILEGES;

Thats all! you have changed your mysql root password. All you have to do is login to phpmyadmin with username as root and password as new password.

Create a new phpmyadmin user

Now we will create a new administrator login (say sysadmin) for phpmyadmin which will have same privileges as mysql root.
Its just one line command;

mysql> GRANT ALL ON *.* TO 'sysadmin'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

then

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Now you can login to phpmyadmin as new administrator and avoid using root logins. You can create databases, change or insert or edit tables or do whatever you want!

Similar Posts:

Tags:

Prabhu Balakrishnan

I am cool and friendly internet entreprenur blogging since 2005. My interests are wordpress, PHP, linux servers, SEO and travel. Besides computers, i am crazy for video games, travel and a cup of hot coffee! I am born in Coimbatore, India but i currently live in Budapest, Hungary. Feel free to contact me folks!

Leave a Reply

Your email address will not be published. Required fields are marked *


× 9 = fifty four

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please wrap all source codes with [code][/code] tags. Powered by
  1. amir

    login with root and password(what so ever) click the privileges tab, click the add new user,
    fill the user name, host password,
    select the privileges which do you want to grant. click the go button, so logout, and login with new user and password.

    Reply
  2. Fenix

    Amir,
    Sorry this does not work. At least in LAMP it does not work. You can create the new user, and grant all priviledges, but it won’t login.

    Reply
  3. Domi

    Hi,

    sorry, this doesn’t work for me too, I can create the user & setup de privilege (I get a Query OK) but I can’t logging with the new user.

    Domi.

    Reply
  4. kevinbeckett

    Yes I love you.
    I installed Zend Server with MySQL and phpMyAdmin, after fumbling the installation of MySQL I COULD NOT log into phpMyAdmin at all. Creating sysadmin user (in the “MySQL Command Line Client”) opened the door to phpMyAdmin. Thank you!

    Reply
  5. Jesus

    Nice man, I’m new in the linux world and after install mysql I wasn’t able to enter as admin, this info put my on track. Thanks.

    Reply
  6. Rakesh

    thanks a ton !!!!!!!!!!!!!!!!!!!!!!!!!!!!
    u guys are so kind to newbies ,thanks for sharing it..
    knowledges makes man…….

    Reply
  7. samir khan

    i am trying to creat password of database in MYSQL. i gave this command
    mysql > update user set password=password(‘XXXXX’) where user=’root’;
    but it gives error 1046

    Reply
  8. samir khan

    i am trying to creat password of database in MYSQL. i gave this command
    mysql > update user set password=password(‘XXXXX’) where user=’root’;
    but it gives error 1046: No database selected

    Reply
  9. Mehere Jan

    i am trying to creat password of database in MYSQL. i gave this command
    mysql > update user set password=password(‘XXXXX’) where user=’root’;
    but it gives error 1046: No database selected
    Please help me

    Reply