Applicable to:
- Plesk for Linux
Symptoms
Failed to access MySQL via SSH using root account even if server root user password is modified.
Cause
By default there is no root user in MySQL for Plesk installation.
Resolution
To get root privileges in MySQL simply login with the admin username instead with one the following commands:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
OR
# plesk db
If it is absolutely necessary, user root can be created with the following steps:
- Log into the Plesk server via SSH;
- Connect to MySQL:
# plesk db
- Run the following command to create root user, put appropriate password replacing mypass:
MYSQL_LIN: CREATE USER 'root'@'localhost' IDENTIFIED BY PASSWORD PASSWORD('mypass');
- Grant all the privileges to this user:
MYSQL_LIN: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'
Comments
2 comments
I get this error
The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.
Hi Che,
Thanks for sharing.
I fixed the article, now it should be fine.
Please sign in to leave a comment.