Solved

Lost my MySQL root password

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Install MySQL 5.6 and PHP on Centos Linux 6 137
MySQL Grouping 2 48
Present Absent from working date rage 11 36
Help With Simple Database Design 7 50
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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