Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mysql headaches.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WeeTzz
n00b
n00b


Joined: 11 May 2003
Posts: 10

PostPosted: Wed May 28, 2003 2:52 pm    Post subject: Mysql headaches. Reply with quote

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
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Wed May 28, 2003 3:15 pm    Post subject: Reply with quote

Maybe you should try :
Code:
/usr/bin/mysqladmin -u root@localhost password 'new-password'

Hope this helps.

-K
Back to top
View user's profile Send private message
WeeTzz
n00b
n00b


Joined: 11 May 2003
Posts: 10

PostPosted: Wed May 28, 2003 3:19 pm    Post subject: Reply with quote

problem is I can't even use the tool anymroe :-/
Back to top
View user's profile Send private message
WeeTzz
n00b
n00b


Joined: 11 May 2003
Posts: 10

PostPosted: Wed May 28, 2003 4:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
joycea
Apprentice
Apprentice


Joined: 23 Jul 2002
Posts: 191
Location: Kingston, Canada

PostPosted: Wed May 28, 2003 5:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
xedx
Tux's lil' helper
Tux's lil' helper


Joined: 23 May 2003
Posts: 93

PostPosted: Thu May 29, 2003 5:35 am    Post subject: ? Reply with quote

do
# mysql -u root -p
then wait for the password prompt
_________________
--+//+
Back to top
View user's profile Send private message
ARC2300
Apprentice
Apprentice


Joined: 30 Mar 2003
Posts: 267

PostPosted: Thu May 29, 2003 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message
billatq
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2002
Posts: 96

PostPosted: Thu May 29, 2003 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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