OK, I've come to the conclusion that I'm doing something wrong, but can't for the life of me figure out what it is. Going over and over and over documentation, I must be interpreting something wrong, because I think I'm doing what it says.
I'm setting up a new box with CentOS. Installed MySQL, and it's running. Now I get to setting the password. Here's the issue.
I start with:
mysqladmin -u root password SQLROOTPASSWD.
No problem
Then I try:
mysqladmin -h myserver.mydomain.com -u root password SQLROOTPASSWD.
This is where things go South. I get the response
mysqladmin: connect to server at '(my server)' failed
"Access denied for user 'root'@'192.168.1.160' (using password: NO)'
I'm at a loss. Hours of fighting with this, and I'm nowhere... Help?
On 03/16/2010 12:56 PM, Raymond J. Henry wrote:
Then I try:
mysqladmin -h myserver.mydomain.com -u root password SQLROOTPASSWD.
use -p or --password
"mysqladmin ... password foo" sets the password, to give a previously set password, just do "mysqladmin -h myserver.mydomain.com -u root -p" to be prompted for it. Or to give it on the command line --password=SQLROOTPASSWD/-pSQLROOTPASSWD.
Peter
The default for mysql clients is to connect with no password. Your first command connects with no password, and sends commands to change the password. Don't confuse the parameters you're sending with the ones you're supposed to send to connect with a password.
To connect with a password, pass "-p" on the command line to have the client prompt for the password, or do the longopt "--password=MYPASSWORD"
eg
$ mysqladmin -u root -p somecommand somearg Enter password:
or
$ mysqladmin -u root --password='abc123' somecommand somearg
Sean
On Tue, Mar 16, 2010 at 12:56 PM, Raymond J. Henry rayhenry@autoclubs.ca wrote:
OK, I’ve come to the conclusion that I’m doing something wrong, but can’t for the life of me figure out what it is. Going over and over and over documentation, I must be interpreting something wrong, because I think I’m doing what it says.
I’m setting up a new box with CentOS. Installed MySQL, and it’s running. Now I get to setting the password. Here’s the issue.
I start with:
mysqladmin -u root password SQLROOTPASSWD.
No problem
Then I try:
mysqladmin -h myserver.mydomain.com -u root password SQLROOTPASSWD.
This is where things go South. I get the response
mysqladmin: connect to server at ‘(my server)’ failed
“Access denied for user ‘root’@’192.168.1.160’ (using password: NO)’
I’m at a loss. Hours of fighting with this, and I’m nowhere….. Help?
Roundtable mailing list Roundtable@muug.mb.ca http://www.muug.mb.ca/mailman/listinfo/roundtable
Raymond J. Henry wrote:
OK, I’ve come to the conclusion that I’m doing something wrong, but can’t for the life of me figure out what it is. Going over and over and over documentation, I must be interpreting something wrong, because I think I’m doing what it says.
I’m setting up a new box with CentOS. Installed MySQL, and it’s running. Now I get to setting the password. Here’s the issue.
I start with:
mysqladmin -u root password SQLROOTPASSWD.
No problem
Then I try:
mysqladmin -h myserver.mydomain.com -u root password SQLROOTPASSWD.
This is where things go South. I get the response
mysqladmin: connect to server at ‘(my server)’ failed
“Access denied for user ‘root’@’192.168.1.160’ (using password: NO)’
I’m at a loss. Hours of fighting with this, and I’m nowhere….. Help?
Roundtable mailing list Roundtable@muug.mb.ca http://www.muug.mb.ca/mailman/listinfo/roundtable
Your problem is that MySQL stores permissions based not only on users, but also where they're coming from.
Try in the mysql console "grant all privileges on *.* to 'root'@'192.168.1.160' IDENTIFIED BY '<yourpasswordhere'" followed by a flush privileges.
All the best, Robert