Solved

Locked out...

Posted on 2004-03-24
6
993 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql query on a varchar that is numeric. 8 47
category table 2 35
UPDATE query not working in mysqli php 8 84
MySQL-Design Help 12 39
Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
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://…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 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