View previous topic :: View next topic |
Author |
Message |
ClippyHater Apprentice
Joined: 06 Nov 2002 Posts: 247 Location: Wisconsin
|
Posted: Wed Nov 13, 2002 2:51 am Post subject: GACK! Any MySQL experts out there... please help! |
|
|
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 |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Nov 13, 2002 3:48 am Post subject: |
|
|
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 |
|
|
ClippyHater Apprentice
Joined: 06 Nov 2002 Posts: 247 Location: Wisconsin
|
Posted: Wed Nov 13, 2002 4:54 am Post subject: Thanks! |
|
|
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 |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Nov 13, 2002 5:14 am Post subject: |
|
|
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 |
|
|
ClippyHater Apprentice
Joined: 06 Nov 2002 Posts: 247 Location: Wisconsin
|
Posted: Wed Nov 13, 2002 2:31 pm Post subject: |
|
|
Very cool, thanks rac! |
|
Back to top |
|
|
Anubis n00b
Joined: 09 Nov 2002 Posts: 68 Location: BYU
|
Posted: Thu Nov 14, 2002 8:55 am Post subject: |
|
|
Hmm....I'm not a big of of uninstall/re-installs (reminds me too much of windows ) 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 |
|
|
|