| Author |
Message |
dishkuvek
Joined: 23 Dec 2004
Posts: 8
Location: Richmond, VA
|
| Posted: Sun Jan 09, 2005 8:27 pm Post subject: quick mysql question (using hostnames) |
|
|
Just a quick one:
When setting up mysql, I can do this:
Code:
# mysqladmin -u root password '******'
But when I try to use a hostname in there, I get this:
Code:
# mysqladmin -u root -h example.host password '*****'
mysqladmin: connect to server at 'example.host' failed
error: 'Host 'example.host' is not allowed to connect to this MySQL server'
How might I get around this? |
|
| Back to top |
|
jax
Joined: 12 Aug 2003
Posts: 20
Location: NY
|
| Posted: Sun Jan 09, 2005 11:09 pm Post subject: |
|
|
| It appears that mysql isn't running. The database server needs to be running in order to update a database. |
|
| Back to top |
|
mastabog
Joined: 03 Apr 2004
Posts: 64
|
| Posted: Mon Jan 10, 2005 5:18 am Post subject: |
|
|
... or the "mysql" database has to be updated giving the user "root" access from the host "example.host". Either do this with "GRANT" after you logged in the mysql client or use "mysqladmin":
Code: # mysqladmin -u root -h "example.host" password 'new-password'
If you do not specify the -h option, then the password is set globally for the root account. |
|
| Back to top |
|
dishkuvek
Joined: 23 Dec 2004
Posts: 8
Location: Richmond, VA
|
| Posted: Mon Jan 10, 2005 1:16 pm Post subject: |
|
|
jax wrote: It appears that mysql isn't running. The database server needs to be running in order to update a database.
The thing is that the database server is running when I issue this command. |
|
| Back to top |
|
jax
Joined: 12 Aug 2003
Posts: 20
Location: NY
|
| Posted: Mon Jan 10, 2005 3:41 pm Post subject: |
|
|
Sorry, read the first post wrong (I seem to do that frequently). If you take a look at the users table in the mysql database, you can specify different permissions to each user based on what host they logged in from. By default, root only has access to login from localhost. So, in order to specify anything else with -h, you first need to grant that access. Either manually insert a row into the table and flush the privileges, or refer to the mysql documentation to learn about GRANT.
http://dev.mysql.com/doc/mysql/en/Secure_GRANT.html |
|
| Back to top |
|
mastabog
Joined: 03 Apr 2004
Posts: 64
|
| Posted: Mon Jan 10, 2005 6:19 pm Post subject: |
|
|
| has any of you read my reply above? :roll: |
|
| Back to top |
|
| |