root, mysql, mariadb.sys gone from mysql.user

Naila

Active Member
Jun 20, 2017
32
0
56
Indonesia
cPanel Access Level
Root Administrator
Hi,

After mysql have small error unable to login with root user all cpanel user access denied in log err mysql. I check from phpmyadmin these user not exist in table user mariadb.sys, root and mysql. I am try recreate/insert command but not work since mysql running with skip-grant-tables.

I was hoping someone could help with recovering the root, mysql and mariadb.sys users in table mysql.user
 
Last edited:

techAMIGO

Well-Known Member
Nov 6, 2019
68
48
18
Kerala, india
cPanel Access Level
Root Administrator
Can you try to fix this by using the automated tool in WHM >> MySQL Root Password? This will attempt a reset of the MySQL root user password on the system, and may be enough to get that resolved for you. If, it is not resolved try the below steps too.
  1. Stop the MySQL server.
  2. Start the MySQL server with the --skip-grant-tables option.
  3. Log into MySQL without a password.
  4. Update the root password using SQL commands.
  5. Restart the MySQL server normally
 
Last edited:
  • Like
Reactions: cPRex

Naila

Active Member
Jun 20, 2017
32
0
56
Indonesia
cPanel Access Level
Root Administrator
Can you try to fix this by using the automated tool in WHM >> MySQL Root Password? This will attempt a reset of the MySQL root user password on the system, and may be enough to get that resolved for you. If, it is not resolved try the below steps too.
  1. Stop the MySQL server.
  2. Start the MySQL server with the --skip-grant-tables option.
  3. Log into MySQL without a password.
  4. Update the root password using SQL commands.
  5. Restart the MySQL server normally
Hello sir,

The server already with skip grant tables. I have do your mentioned, but user root, mysql is not in the list table mysql.user. Change password from whm interface work well but i don't know why root user still unable to login (Access denied for user).
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
The best option in this case would be to restore the database from a backup.


If you don't have a backup available, there isn't an easy way to recreate those system tables, as those are installed by MySQL at the time of installation.