LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How do I add a host user password to mysql server? (https://www.linuxquestions.org/questions/linux-networking-3/how-do-i-add-a-host-user-password-to-mysql-server-38305/)

cmisip 12-13-2002 10:46 PM

How do I add a host user password to mysql server?
 
I have mysql server running on PC1 and need to access it from PC 2. When I try mysql -h 192.168.1.252 -u mythtv from PC 2 I get:

Error 1130 Host '192.168.1.1' is not allowed to connect to this MySQL server

Thanks

markus1982 12-14-2002 01:47 AM

You need to grant the privileges like that:

GRANT Select, Insert, Update ON database.* TO 'mythtv'@'192.168.1.1' IDENTIFIED BY 'password';


What privileges you give that user and on what database is in your hands of course ...

cmisip 12-14-2002 11:56 PM

I want to grant the user mythtv@192.168.1.1 read write access to the database named mythconverg on the mysql server on 192.168.1.252 using password mythtv. How do I do this?

I tried on the PC with the mysql server:

su
mysql mysql
msyql> grant all privileges on *.* to mythtv@192.168.1.1 identified by 'mythtv' with grant on;
mysql> exit

This seemed to work last night and I was able to access
the database. However it doesnt work this morning. I get an Error 2003: Cant connect to Mysql server on '192.168.1.252' (111) when I try to do a
user@localhost]mysql -h 192.168.1.252 -u mythtv

If i append a -p at the end of that, it prompts me for a password and then shows me the error. So apparently I am able to access the mysql server but authentication fails.

If i try to access locally on the mysql server, I can access. Any ideas?

ascii2k 12-16-2002 09:57 AM

When it prompts you for the password aren you giving it the correct password?? Also, you may possibly need to add the user "mythtv@192.168.1.1" to the USER table in the MYSQL database. After this you should grant the privileges you want and then you need to issue the command "flush privileges" OR restart the mysql server for the changes to take effect.
You could also just add the user "mythtv@%" to allow that user to connect from ANY host. All of this information is in the mySQL documentation as well.


All times are GMT -5. The time now is 02:44 AM.