The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySql root user missing

Discussion in 'Database Discussions' started by minosjl, Nov 2, 2011.

  1. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello All,

    After installing cpanel on a new server, when i checked the mysql databse, i can see that the mysql root user entires are missing from the user table,becase of this no mysql root access and in cpanel when i tried to create a database it shows the the offline error.

    What the cause of this error.I have temporally fixed this issue by adding the skip-grant-tables entry in the my.cnf file.

    Please some one help me on this...
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Are you able to set one here:

    WHM > SQL Services > MySQL Root Password
     
  3. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    i have tried that , this one shows no error ,able to reset the password and also the file /root/.my.cnf exists with correct permission 600
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The problem is, exactly? I'm sorry but I'm unclear on the issue I think.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What MySQL version are you running? You can re-add the root user privileges, although it would probably be better just to reinstall MySQL itself if you don't have anything on this new machine for databases anyway.

    You can reinstall MySQL just by doing:

    Code:
    mv /var/lib/mysql /var/lib/mysql.bak111102
    /scripts/mysqlup --force
    After you do this, root will still be unable to log into MySQL command line, but you can then go to WHM > SQL Services > MySQL Root Password area and set the root password. It should work. I just tested it on my own machine and it worked fine to get the root user privileges back.

    Again, this would be when you don't have existing databases already and this is a new machine. Do not try on a machine with databases. There are better ways to go about it when that's the case.
     
  6. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    thnks,it works, i also reinstalled the cpanel from scratch.Looks like cpanel installation is corrupted,thats why mysql root user entry is missing from the user tables.In that case ,
    is it possible to add the table entry from our end ? ,if the default table entries are missing,your answer is much appreciated in this matter.
     
Loading...

Share This Page