Solved

Locked out...

Posted on 2004-03-24
6
996 Views
Last Modified: 2012-06-27
I set a root pw for mysql after setting it up on a server.  Since then I'm locked out as root.  Is there anyway to fix this without reinstalling mysql?
0
Comment
Question by:source2k3
[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
  • 4
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
vanekl earned 500 total points
ID: 10668540
0
 
LVL 1

Author Comment

by:source2k3
ID: 10669122
Hmm, first following the instructions, I found the pid in
/var/run/mysqld/mysql.pid

but when typing the command as the guide shows:
kill 'cat /var/run/mysqld/mysql.pid' I get no such pid.

Soo...I killed the pid manually with the numeric pid shown in ps aux.

I then tried using the command shown in the guide to restart the server:

mysqld_safe --skip-grant-tables &

It said mysqld_safe is an unknown command...

So I used service mysqld start --skip-grant-tables &
which appeared to work...

I then tried to follow the next step which was to type

mysqladmin -u root flush-privileges password "newpwd"

This gave me the error:

ERROR 1044: Access denied for user: '@localhost' to database 'mysql'


Help? :(
0
 
LVL 6

Expert Comment

by:vanekl
ID: 10669423
What version of mysql are you using?
The mysqld_safe script may also be called safe_mysqld, and it may either be in the mysql/bin
directory or the mysql/scripts directory. It would make things easier if you used this script.

The reason why mysqld start --skip-grant-tables didn't appear to work is because the --skip-grant-tables
option was probably ignored since 'start' is not a valid option. You should use,

mysqld_safe --skip-grant-tables

or

safe_mysqld --skip-grant-tables
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 1

Author Comment

by:source2k3
ID: 10674074
Okay, reversing it like you suggested worked...kinda.

typing
safe_mysqld --skip-grant-tables
gives me:
Starting mysqld daemon with databases from /var/lib/mysql
then it just sits there without bringing me back to a shell prompt or anything.

If I open another ssh session I can see that mysqld is running on the process list, but it won't give me access to reset the permissions.

Man this is frustrating.
0
 
LVL 1

Author Comment

by:source2k3
ID: 10674129
Okay, I was missing the & at the end of safe_mysqld --skip-grant-tables &.

I was then able to issue the flush privileges command and it appears to work, but it then gives me:
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

Why is it giving a blank instead of the @?  Shouldn't it say root there?

I'm really not an idiot....I promise....
0
 
LVL 1

Author Comment

by:source2k3
ID: 10674486
Okay, you can disregard.  

I said f*** it and just uninstalled mysql completely, and reinstalled it.  It's all set now.

Thanks for trying to help though.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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