View previous topic :: View next topic |
Author |
Message |
macawgumbo Apprentice
Joined: 28 May 2004 Posts: 165
|
Posted: Sun Jan 16, 2005 9:41 pm Post subject: Root doesn't have access to MySQL Database?! [FIXED] |
|
|
Root is not able to connect to the MySQL database and I just installed it. How is that? There is no way to set the password for the mysql user it says invalid token authentication when doing passwd mysql. I can't change the root mysql password because root can't connect. ??
Last edited by macawgumbo on Sun Jan 16, 2005 10:51 pm; edited 1 time in total |
|
Back to top |
|
|
keyson l33t
Joined: 10 Jun 2003 Posts: 830 Location: Sweden
|
Posted: Sun Jan 16, 2005 9:56 pm Post subject: |
|
|
Hi.
You have emerge it. But have you setup the databases ?
And have you started the mysql ?
You don't have to set the password for mysql as it not a user.
Try this as root
Read the info produced after this command.
Then start the mysql
Code: | /etc/init.d/mysql start |
Use mysqladmin to set the password for the databas root user.
(you may skip the line with the host in.
mysqladmin -u root -h $hostname password 'new-password'
as this use to fail becaus of othe setup isue)
Use this
mysqladmin -u root password 'new-password'
The only thing you should change in this line is the
'new-password', enter your password instead between the ' '.
Do not mix this user with the root user for your machin. They are not
the same the mysql is using it's own table for access control.
-Kjell |
|
Back to top |
|
|
macawgumbo Apprentice
Joined: 28 May 2004 Posts: 165
|
Posted: Sun Jan 16, 2005 10:04 pm Post subject: |
|
|
Code: | error: 'Access denied for user: 'root@localhost' (Using password: NO)'
|
|
|
Back to top |
|
|
keyson l33t
Joined: 10 Jun 2003 Posts: 830 Location: Sweden
|
Posted: Sun Jan 16, 2005 10:23 pm Post subject: |
|
|
OK.
Stop the database
Code: |
/etc/init.d/mysql stop
|
remove the database mysql and test in
/var/lib/mysql
Rerun the script
Code: |
/usr/bin/mysql_install_db
|
Start up the mysql and now try to connect as root.
(you don't need to be root user on your machine)
If this connects then exit and run
Code: | mysqladmin -u root password 'new-password' |
-Kjell |
|
Back to top |
|
|
macawgumbo Apprentice
Joined: 28 May 2004 Posts: 165
|
Posted: Sun Jan 16, 2005 10:50 pm Post subject: |
|
|
It works. Thanks.
How do you make it prompt for password when you do a |
|
Back to top |
|
|
keyson l33t
Joined: 10 Jun 2003 Posts: 830 Location: Sweden
|
Posted: Sun Jan 16, 2005 10:55 pm Post subject: |
|
|
You can type
then it ask for the password. But you have to set it befor that.
Code: |
mysql -u root -ppassword
|
(OBS no space between the -p and password)
make it enter whitout asking.
-Kjell |
|
Back to top |
|
|
|