Solved

Lost my MySQL root password

Posted on 2011-09-24
5
345 Views
Last Modified: 2012-06-22
Hello,

I have lost mysql root password I am persuaded that I am typing in the correct password but mysql says no.

I have tried (several times - sucker for punishment) to uninstall in control panel, I ran the mysql package and removed the instance and then reinstalled it.

I am running vista home premium SP2.

If I run mysql without -p I can enter mysql no problem

Tempted (if I had the money) to buy new pc and strart again ;-)

Thank you for reading this

A pointer mysql support resources would be good

Thanks

John
0
Comment
Question by:johnecollins
5 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 500 total points
ID: 36591995
For Windows, instructions are here. Good luck :)
0
 
LVL 1

Expert Comment

by:jedblack
ID: 36594556
In the past, I've done the unix and windows steps from the link gerwinjansen posted, works like a charm -- just follow it exactly...
0
 
LVL 19

Expert Comment

by:jools
ID: 36596332
if you run mysql and dont use the -p option doesnt that just mean there is no password set for the user specified in the -u?
0
 

Author Comment

by:johnecollins
ID: 36598692
gerwinjansen and jedblack,

Sorry to be slow in responding but I will get to it this evening thank you so much for your help

jools,

I do believe there is a difference I am not sure what it is but if you login -p and type show databases you get a different result from login with no password. If I could get in and test it I would ;-)

Thanks

John
0
 

Author Closing Comment

by:johnecollins
ID: 36908554
hi gerwinjansen,

I have finally got around to do doing this and I have learnt a lot from it.

I gave the grade as 'A' because it did the job!

The solution was not complete, accurate or easy.

You gave me the link to the eventual solution, so you get the grade 'A'

Issues I had were
1 the spaces in the directory names in my directory structure I delimitted those directories with double quotes
2 the command line omitted space between the program mysqld and the switch -nt
3 I believe there is a missing line in the init.txt - use mysql;
I had a look at what the commands in init.txt were trying to do and queried the user table fields host, user and password. THE PASSWORD field was blank???????? and I logged in -u root -p and pressed return rather than trying to type a password and got in!!

After all this I thought why don't I login without -p and run "use mysql" the  lines in the init.txt at the mysql command line and see what result I get.
It worked.
so thank you

jedblack

Thanks for your encouragement - it helped

jools
thinking again I think you were right I was confusing logging in with and without a user name. If you show databases in both modes you get a smaller list without user name than with.

so thank you all very much we can close it;-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Creating and Managing Databases with phpMyAdmin in cPanel.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question