Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql woes
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
akira420
n00b
n00b


Joined: 17 May 2003
Posts: 45

PostPosted: Sun Sep 07, 2003 2:21 am    Post subject: mysql woes Reply with quote

i've emerged mysql, then cp'ed /etc/mysql/my.cnf.xxx to /etc/mysql/my.cnf, changed permissions on /var/lib/mysql to what they need to be. and ran the mysql_install_db then started /etc/init.d/mysql start.

a 'ps -aux' show's that mysql is in fact running running. but when ever i attempt to change my initial root password i get:
Code:

bash-2.05b# /usr/bin/mysqladmin -u root -h linux password 'new-password'
/usr/bin/mysqladmin: connect to server at 'linux' failed
error: 'Lost connection to MySQL server during query'


so i tried:
Code:

bash-2.05b# /usr/bin/mysqladmin -u root -p 'new-password'
Enter password:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'


what am i doing wrong. i see that this is not un-common problem, it's just that the solution is not often addressed. can anybody help?
_________________
you can pick your friends, and you can pick your nose, but you can't pick your friends nose
Back to top
View user's profile Send private message
Ox-
Guru
Guru


Joined: 19 Jun 2003
Posts: 305

PostPosted: Sun Sep 07, 2003 3:37 am    Post subject: Reply with quote

Don't use the -h option when setting the root password. This is because what you want to do is set the password for root@localhost (not root@linux like you are trying to do).

So, first do this:
Code:
mysqladmin -u root password 'new-password'

In your second try, you couldn't connect because you hadn't properly set root@localhost password yet. If you had, that command still would have failed because it wouldn't have understood the command 'new-password'.

Once you've set the root password properly, try connecting like this instead:
Code:
mysql -u root -p
and enter the correct password when prompted.

Side note: anytime you use the -p option on mysql or mysqladmin command lines, it will always prompt for the password. So don't put the password on the command line (except for when you set it using mysqladmin).
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