Solved

Lost my MySQL root password

Posted on 2011-09-24
5
341 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 37

Accepted Solution

by:
Gerwin Jansen 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now