• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Access denied for user 'admin' when creating database on MySQL

kousinovalis

New Pleskian
Hello
When i try to create a database i get the error Access denied for user 'admin'.
I tried to create a database from outside the Plesk connecting directly to the database with another user and it was successfully
Where can i see the password of this user admin or change it?
Thank you
 
Hello,

Hope you are doing well..!!

To solve the issue and reconnect Plesk to the MySQL server do the following:

  • Connect to the server using RDP.
  • Stop the MariDB server (but not "Plesk SQL Server") from running on port 3306 using the Plesk Services Monitor, which can be started from the Windows Start menu.
  • Edit the MariaDB configuration file %plesk_dir%Databases\MySQL\my.ini and add the line skip-grant-tables to the [mysqld] section and save it using text editor:
    [mysqld]
    skip-grant-tables
  • Start the MariaDB server using the Plesk Services Monitor.
  • Log into MySQL without the password:
    "%plesk_dir%\MySQL\bin\mysql.exe" -P3306
  • Change the password for the MySQL administrator:
    For MySQL 5.7.6 and newer as well as MariaDB 10.1.20 and newer, use the following command:
    ALTER USER 'admin'@'localhost' IDENTIFIED BY 'new_password';
    For MySQL 5.7.5 and older as well as MariaDB 10.1.20 and older, use:
  • SET PASSWORD FOR 'admin'@'localhost' = PASSWORD('new_password');
    Note: Make sure to replace 'new_password' with a new password of choice.
  • Tell the database server to reload the grant tables by issuing the FLUSH PRIVILEGES command;
    FLUSH PRIVILEGES;
    If there is no user "admin" in MySQL:
    mysql> ALTER USER 'admin'@'localhost' IDENTIFIED BY 'new_password';
    Query OK, 0 rows affected (0.00 sec) <-- No user "admin" found
    Create the admin user and grant all privileges:
    mysql>CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
    mysql>GRANT ALL PRIVILEGES ON *.*TO 'admin'@'localhost' WITH GRANT OPTION;
  • Remove skip-grant-tables from the MySQL configuration file and restart the service.
  • Log in to the Plesk interface, go to the database server management settings ( Tools & Settings > Database Servers ), and change the password for the corresponding database server to the one set in Step 5. Plesk will re-establish the connection to the server

 
Thank you for the answer
I tried and when i go to Plesk - database servers and try to change password i get the error
"Unable to encrypt data: Access is denied. (Error code 5) at RegCreateKeyEx subKey=SOFTWARE\Plesk\PSA Config\Config\sym_key<br> at (registry::create line 42)<br> at (zif_plesk_symmetric_encrypt line 2303)"
which is an issue when i also try to create a new database user
 
Try to reconnect to the server of the database software. Maybe there is a problem with the connection, and it will solve your problem. I also had a similar situation. I was logged in with my main account, but there was a write that only the admin can edit the databases. It was strange for me because I was the admin, and I couldn't edit the databases. I logged out and reconnected back to the servers of databases. It helped, and it opened me to the tools for editing and creating databases, and maybe it will work for you too.
 
Back
Top