After the successful installation of VestaCP on a ubuntu 18.04 LTS virtual private server, there is a login problem for PHPMyAdmin. When we try to login to PHPMyAdmin using the correct password, a problem with code “
(HY000/1045): Access denied ” occurred.
If you have any doubts regarding your VestaCP installation, I would suggest you look out this tutorial.
What is the problem?
(HY000/1045): Access denied for user 'PHPMyAdmin'@'localhost' (using password: YES).
Vestacp access denied for user ‘root’@’localhost’
Now the question is, how to solve this vital problem? There are a number of solutions regarding this problem. In this post, I am sharing a solution to that particular problem.
Solution: Connect your server using PuTTy SSH or other whatever you want. Make sure you have administrative or root privilege. If not then use the following command followed by your password.
First, make sure that you have changed the default vesta password in
mysql.conf file. If not, then change it using the commands given below.
Then use the following command-
mysql -u root -p
Now enter your password and hit enter. Using this command now you have entered into MySQL command-line interface (CLI) service. Now type –
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxxxx';
xxxxxxx” is to be replaced. Hit enter key. Now you can log in to your PHPMyAdmin.
If the above solution does not world you may try the second solution.
Solution 2: Changing the MySQL root password
If solution 1 does not work, then try this.
Stop MySQL service
sudo service mysql stop
Then try the following commands-
sudo mkdir -p /var/run/mysqld
sudo chown mysql /var/run/mysqld
Now stop MySQL service using the following command-
sudo service mysql stop
Then use these commands-
sudo mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
Now update user password using command-
update user set password=PASSWORD("xxxxxxxx") where User='root';
xxxxxxxx” is to be replaced by your own password. Then use the last command.
Solution 3: UPDATE user SET
In general, this solution works on ubuntu 14.04 to 16.04. This is pretty much similar to solution 2. This may work on CentOS. Use the commands given below.
sudo mysql -u root
Provide your root password and hit the enter key.
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
service mysql restart
You are done. Now you can log in to your PHPMyAdmin page using your password.
This is a common problem with vestaCP. Whenever I install VestaCP on ubuntu, I face this problem each time. In my case, I am using Ubuntu 18.04 and solution 1 work for me. I hope one of these solutions will also work for you. If not, please leave a reply.
|You May Also Like|
|[How To] Change Default Admin Login Port(8083) of VestaCP?|