Solved

Lost my MySQL root password

Posted on 2011-09-24
5
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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