PHPMyAdmin Error; #1045 Cannot log in to the MySQL server.
PhpMyAdmin is a free and open source tool written in PHP intended to handle the administration of MySQL with the use of a web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions.
Accessing PhpMyAdmin without cPanel login?
This article will help you to access databases of cPanel users’ without accessing the cPanel account.
Consider the scenario, you’ve a cPanel account and you want to share the details of a database (DB) with one of your we site developers and actually you do not want to share the cPanel credentials.
This is an error that I received while accessing PHPMyAdmin via cPanel. Please see the error details below:
# 1045 Cannot log in to the MySQL server
1. Check MySQL service is running. You can check this by running the following commands:
# /etc/init.d/mysqld status # pidof mysqld # netstat -plan | grep :3306
# /etc/init.d/mysqld status mysqld (pid 23832) is running... #pidof mysqld 23832 # netstat -plan | grep :3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 23832/mysqld
If you are getting the expected output, then try to log in the MySQL prompt by running
# mysql -u root -p
If you are able to log into the MySQL prompt then we can conclude that your MySQL server is up and running.
If not, then your MySQL service is stopped for any reason.
In that case, you can try running
Even after starting MySQL, if it’s not started then you need to investigate the root cause why the MySQL service is down. For an initial testing, you can check
#df -h #free -m
Also, check the permission of /tmp and see if you can touch a file in /tmp. If all this cases are fine, then you need to check the MySQL logs in the file /var/lib/mysql/hostname.err or you can check in /var/log/mysqld.log .
In this way you can troubleshoot why the MySQL service is down.
If your MySQL server is up and again you are receiving the error as #1045 Cannot log in to the MySQL server then, you can continue reading this.
2. Reset the cPanel password for the user that you are facing this problem. Make sure that “Allow MySQL password change” has been enabled while you are changing the password.
How to access PhpMyAdmin without cpanel password?
Update: Just reviewed the post. It’s a very old post and for cPanel servers. No sure if it correct for latest WHM/cPanel servers.
11 thoughts on “[Solved] PHPMyAdmin Error; #1045 Cannot log in to the MySQL server”
Restablecer contraseña mysql del servidor debería funcionar si ninguna de las anteriores trabajó
thanks for the solution.. i was fed up by serching for this answer… thanks alot
You’re most welcome, Raj!
i cant understand this, where do i type the /etc…. ? in the cmd? in what directory?
In you server through CLI.
Please am still having that error. After installing my wampserver, it could not turn green, i was adviced to change the port no to port 7080 and listen 127.0.0.1 since the default port was in use by another program, i did it and it turned green but the problem now is that i cant login into the admin page of mysql as i keep getting error “cannot log in to the mysql” pls i hv tried all i could to no avail.
If the problem persists, please open a support request.
getting an error
#1045 Cannot log in to the MySQL server
help me how to solved it
thanks for shared wonderful articles