What is my MySQL root password?

5,877

Solution 1

There is no way to lookup the password. It is encrypted. On many systems the root password is blank by default. On other systems you would have been asked to set the root password when you installed mysql. The password reset procedure is described here (http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html).

Solution 2

If you manage to get a shell you can set it this way:

Start mysql with:

mysqld_safe --skip-grant-tables

Log in mysql

mysql --user=root mysql

Update the root password:

UPDATE user SET Password=PASSWORD('newpwd') WHERE User='root';
flush privileges;
exit;
Share:
5,877

Related videos on Youtube

Mike Holdsworth
Author by

Mike Holdsworth

(Last updated 2018-08-28.) http://stackoverflow.com/questions/1825585/how-to-determine-what-version-of-powershell-is-installed/1825807#1825807 Experienced application developer. Software Engineer. M.Sc.E.E. C++ (10 years), software engineering, .NET/C#/VB.NET (7 years), usability testing, Perl, scientific computing, Python, Windows/Macintosh/Linux, Z80 assembly. My other accounts: iRosetta. [/]. Stack Overflow (SO). [/]. Server Fault (SF). [/]. Super User (SU). [/]. Meta Stack Overflow (MSO). [/]. Careers. [/]. Other My 15 minutes of fame on Super User Blog. Sample: Jump the shark. LinkedIn profile @PeterMortensen (Twitter) Google profile Quora profile GitHub profile Full jump page with other SOFU related, Stack Exchange sites, etc. Contact I can be contacted through this reCAPTCHA (requires JavaScript to be allowed from google.com).

Updated on September 17, 2022

Comments

  • Mike Holdsworth
    Mike Holdsworth over 1 year

    Where or how do I check MySQL root password? I don't have a .my.cnf file, I can't login to SQL console (it requires a password), I can't do anything.

  • Admin
    Admin over 14 years
    arggg... so troublesome!!! Is there any easier way?
  • meder omuraliev
    meder omuraliev over 14 years
    Um - How did you install it?
  • Admin
    Admin over 14 years
    I think it installed by my web hosting company. What should i do? I must reset the password?? No others options?? (sigh)
  • Zoredache
    Zoredache over 14 years
    Yeah, remember what the password was if you setup the system. Or go find the person who set it up for you and ask them. If you can't manage that you could, provide more details about what type of environment (OS/Version/etc) you are running on, and somebody might provide you with step-by-step details.
  • Zoredache
    Zoredache over 14 years
    You could call your the support number for your web hosting company. They almost certainly have the procedure down pat.
  • Admin
    Admin over 14 years
    Yeah, i drop them an email. Hopefully it can be settled easily.
  • fxmtor
    fxmtor over 14 years
    What's with making things that big?