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:
- Fix: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
- Install LAMP Server for Centos/RHEL
- Your password is 180 days old, and has therefore expired
- Optimizing MySQL Rand() against Slowdowns
- MySQL delete is very slow and takes long time!
- FIX->Fatal error: Maximum execution time of 300 seconds exceeded with phpMyAdmin
- How to install a local copy and configure WordPress on Ubuntu
- How to Connect iPod Touch to Internet that Requires Username/Password
- WordPress – How to create a login protected page?
- how to secure a wireless router/modem?





November 18, 2008
Thanks for this – it was very useful to a noob like me
May 22, 2009
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.
October 14, 2009
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.
April 28, 2010
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.
December 17, 2010
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!
April 25, 2011
You’re PHP superhero thks appreciate it
July 19, 2011
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.
February 15, 2012
thanks a ton !!!!!!!!!!!!!!!!!!!!!!!!!!!!
u guys are so kind to newbies ,thanks for sharing it..
knowledges makes man…….
June 14, 2012
may i know where to write this query to setup a password for user root…????
January 25, 2013
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
January 25, 2013
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
January 25, 2013
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
January 28, 2013
before running this command use