Solved

Lost my MySQL root password

Posted on 2011-09-24
5
339 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
Comment Utility
For Windows, instructions are here. Good luck :)
0
 
LVL 1

Expert Comment

by:jedblack
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now