mysqlUnknown MySQL host

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
twb
Forum Commoner
Posts: 27
Joined: Thu Jan 06, 2005 4:39 pm

mysqlUnknown MySQL host

Post by twb »

I am new to mysql. In my sql database I have created a user and gave it the host '%' rather than localhost, this is so it will allow any host to connect to it. When I try to connect to the DB with the command "

Code: Select all

mysql -h '%' -u user1 -p userpassword
" I get a "ERROR 2005 (HY000): Unknown MySQL host '%' . I am logged in as the root@localhost when trying to do this. I am sure that I have to modify some particular file but not sure which? Thanks in advance for any help.
Twb

User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

-h host specifies to which mysql server you want to connect.
And you do not want to connect to the server %
twb
Forum Commoner
Posts: 27
Joined: Thu Jan 06, 2005 4:39 pm

mysql unknown mysql host

Post by twb »

I see, I entered the ip of the server after -h and I works fine.
Thanks for your help
Post Reply