Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GACK! Any MySQL experts out there... please help!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Wed Nov 13, 2002 2:51 am    Post subject: GACK! Any MySQL experts out there... please help! Reply with quote

Did a tremendously stupid thing. When first setting up my Gentoo system, I installed MySQL and added a password for root@localhost and root@mybox that's pretty much random characters/numbers. I wrote down the passwords until a time that I needed them (local security is of no concern here, it's at home). Now, I need them, but the paper has disappeared in what is probably someone's cleaning binge... So, I can't log on to MySQL. Now, when you're done laughing (don't worry, after cursing a bit, I chuckled too, hehe), how on earth to I clean things up and start fresh? I tried emerge unmerge mysql, then emerge mysql (after /etc/init.d/mysql stop), but I still can't get in. Please, can someone help? Thanks!
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Nov 13, 2002 3:48 am    Post subject: Reply with quote

How about something like this:
Code:
# cd /var/lib/mysql
# mv mysql mysql.unk
# mysql_install_db

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Wed Nov 13, 2002 4:54 am    Post subject: Thanks! Reply with quote

Took a look at your suggestions, then decided to be extreme, lol...

I did yet another emerge unmerge mysql.

Then did a rm -Rf /var/lib/mysql

Then did emerge mysql.

Everything's back to great again :)
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Nov 13, 2002 5:14 am    Post subject: Reply with quote

BTW, in the future, you can use the makepasswd utility (one of my first ebuilds that made it into Portage) to generate random passwords, and then create ~/.my.cnf files containing them. chmod them 600, and the next time somebody throws out the little scraps of paper, you won't care.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Wed Nov 13, 2002 2:31 pm    Post subject: Reply with quote

Very cool, thanks rac!
Back to top
View user's profile Send private message
Anubis
n00b
n00b


Joined: 09 Nov 2002
Posts: 68
Location: BYU

PostPosted: Thu Nov 14, 2002 8:55 am    Post subject: Reply with quote

Hmm....I'm not a big of of uninstall/re-installs (reminds me too much of windows :P) so here's a way to start mysql skipping root password and then changing it:

1. First kill the server. A simple kill <pid#> will do.

2. Restart the server with:

mysqld --skip-grant-tables &

3. Enter mysql (and the mysql database) as root:

mysql -u root mysql

4. Set a new root password:

UPDATE user SET Password=PASSWORD('mynewpassword')
-> WHERE User='root';
FLUSH PRIVILEGES;

5. Stop the server, and restart it as you normally would.

That should do the trick quite nicely.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum