Mysql – Connect to MySQL Database on Local Network


I actually thought I could do this until I tried. I installed MySQL server on one PC in the Local network IP Address ( and now I am trying to access it from another PC in the same network ( but I am unable:

C:\Users\DOMICO>mysql -u domico -h -p
Enter password: **********
ERROR 1045 (28000): Access denied for user 'domico'@'DOMICO-PC' (using password:

Surprisingly DOMICO-PC is the PC I am trying to connect from. Why is it not connecting to the given host but trying to connect to Local machine?

Best Solution

You need to give permissions to connect from remotehost

mysql>GRANT ALL PRIVILEGES ON database.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;