View previous topic :: View next topic |
Author |
Message |
WeeTzz n00b
Joined: 11 May 2003 Posts: 10
|
Posted: Wed May 28, 2003 2:52 pm Post subject: Mysql headaches. |
|
|
I've installed mysql 3.23 and right away it tells me to do this:
Code: |
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h starscream password 'new-password'
See the manual for more instructions.
|
ok so i start it, then I do what it says and type:
Code: | /usr/bin/mysqladmin -u root password thisreallyisntmypassword |
Then I type the next part and get an error:
Code: | root@starscream conf.d # /usr/bin/mysqladmin -u root -h localhost password thisreallyisntmypassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
| '
I'm not sure what I did, but I can't reverse it and unmerging it doesn't get rid of database so I can start over and retry.
I can exit my root shell and access mysql just fine, but not as root and I can't do any admin stuff anymore. what the heck?
anyone know?
[/code] |
|
Back to top |
|
|
Koon Retired Dev
Joined: 10 Dec 2002 Posts: 518
|
Posted: Wed May 28, 2003 3:15 pm Post subject: |
|
|
Maybe you should try :
Code: | /usr/bin/mysqladmin -u root@localhost password 'new-password' |
Hope this helps.
-K |
|
Back to top |
|
|
WeeTzz n00b
Joined: 11 May 2003 Posts: 10
|
Posted: Wed May 28, 2003 3:19 pm Post subject: |
|
|
problem is I can't even use the tool anymroe :-/ |
|
Back to top |
|
|
WeeTzz n00b
Joined: 11 May 2003 Posts: 10
|
Posted: Wed May 28, 2003 4:50 pm Post subject: |
|
|
Koon wrote: | Maybe you should try :
Code: | /usr/bin/mysqladmin -u root@localhost password 'new-password' |
Hope this helps.
-K |
I did a new install, and i tried what you said above and i got this: Code: |
root@starscream / # /usr/bin/mysqladmin -u root@localhost password fakepassword
/usr/bin/mysqladmin: unable to change password; error: 'Access denied for user:
'@localhost' to database 'mysql''
|
wtf?
i just installed it.!@#J@!??? |
|
Back to top |
|
|
joycea Apprentice
Joined: 23 Jul 2002 Posts: 191 Location: Kingston, Canada
|
Posted: Wed May 28, 2003 5:07 pm Post subject: |
|
|
Maybe if you try removing /var/lib/mysql directory. I don't think re-emerging would have changed this. This is the mysql data directory so I imagine this is where mysql will be saving the root password.
Don't do this if you actually have data in the database, but it seems as though you don't as you are just starting to install it. |
|
Back to top |
|
|
xedx Tux's lil' helper
Joined: 23 May 2003 Posts: 93
|
Posted: Thu May 29, 2003 5:35 am Post subject: ? |
|
|
do
# mysql -u root -p
then wait for the password prompt _________________ --+//+ |
|
Back to top |
|
|
ARC2300 Apprentice
Joined: 30 Mar 2003 Posts: 267
|
Posted: Thu May 29, 2003 5:47 am Post subject: |
|
|
Delete the mysql directory, rerun the script, exit to normal user lever, then type "mysql -u root mysql" and you should be able to get in. Then type "SET PASSWORD FOR root@localhost=password('insertyourpasswordhere');".
It must be typed like that.
It took me a good 2 hours to figure out. Check out http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Default_privileges
That's where I found out how to do it, and it was by total accident. However, I forgot to use "mysql" in my USE tags, so crap got screwed up and I had to emerge stuff again.
Anyways, hope that helps. |
|
Back to top |
|
|
billatq Tux's lil' helper
Joined: 09 Jun 2002 Posts: 96
|
Posted: Thu May 29, 2003 8:01 am Post subject: |
|
|
Well, it's probably too late to be useful for the poster of the thread, but in case someone hits this in a search, you can usually reset the mysql root password by stopping the daemon via the initi scripts, and then restarting it manually with --skip-grant-tables (as root)
This does more or less what it says and ignores the permissions so that you can reset the mysql root password. Then you can kill the daemon and restart it again with the init scripts. |
|
Back to top |
|
|
|