Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: MySQL Root Password
PostPosted: Fri Jul 23, 2004 4:30 am 
Offline
Senior Newbie

Joined: Tue Jul 20, 2004 5:07 am
Posts: 14
I have successfully installed apache+php+mysql on my linode, however I am a little unsure has to how to change the root password for the SQL server (or add other accounts for that matter).

Does anybody have any insight?


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2004 7:48 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
Simple answer:
Code:
shell_prompt> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('new_password');
mysql> SET PASSWORD FOR ''@'my_host_name' = PASSWORD('newpassword');

Check here - http://dev.mysql.com/doc/mysql/en/Default_privileges.html - for the definitive answer.

Before you set the passwords, you need to have run the setup program (mysql_install_db) to build and initialse the grant tables Some distros (notably RedHat) run mysql_install_db during the install, some leave it to you to do it later (for example - Gentoo). Guidance here - http://dev.mysql.com/doc/mysql/en/Unix_post-installation.html

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Fri Jul 23, 2004 6:37 pm 
Offline
Senior Newbie

Joined: Tue Jul 20, 2004 5:07 am
Posts: 14
It's not working for some reason. I keep getting:

Quote:
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'


Any ideas?

Edit: Oh yes, that's using the command:
Quote:
/usr/local/mysql/bin/mysqladmin -u root password new_password


Top
   
 Post subject:
PostPosted: Sat Jul 24, 2004 3:28 am 
Offline
Senior Newbie

Joined: Wed Jul 02, 2003 6:46 am
Posts: 13
Location: UK
Looks like it's trying to use a password even though you have not specified the '-p' option. You cound have a password set in /etc/my.cnf or ~/.my.cnf (or whatever it is on your system).

Try:
Code:
shell_prompt> mysql -u root -p


But just press [return] at the password prompt.


Top
   
 Post subject:
PostPosted: Sat Jul 24, 2004 7:58 am 
Offline
Senior Newbie

Joined: Tue Jul 20, 2004 5:07 am
Posts: 14
Thanks buddy, good thinking :-)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group