MySQL Forums
Forum List  »  Newbie

Re: Accidentally deleted root account - backup available, how to restore?
Posted by: Sander Overvliet
Date: March 28, 2006 03:11AM

Hello Valerie,

Thank you for your time and effort. I have access again :)

I followed your first suggestion and received the following output:

Shell 1:
[root@firefox ~]# whereis mysqld
mysqld: /usr/sbin/mysqld /usr/share/man/man1/mysqld.1.bz2
[root@firefox ~]# cd /usr/sbin
[root@firefox sbin]# service mysqld stop
Stopping MySQL: [ OK ]
[root@firefox sbin]# ./mysqld_safe --skip-grant-tables --skip-networking
bash: ./mysqld_safe: No such file or directory
[root@firefox sbin]# mysqld_safe --skip-grant-tables --skip-networking
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/
060328 10:34:00 mysqld ended

[root@firefox sbin]#
Shell 2:
[root@firefox sbin]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[root@firefox sbin]#

So that didn't quite work as expected, the process was ended before I could even access it. So I moved on to your second solution and copied the mysql data from a spare machine over to this one, fixed the permissions and restarted mysqld.. and there was root again :)
I'm backing up the data folders as they are now, should this ever happen again (which I sincerely hope not) I can redo the mysql data folder quicker and reset everything. And i'm not going to associate MySQL's root with Linux' root ever again - they are two separate entities that obviously have nothing to do with eachother.

Thanks again for your help :)

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.