Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a remote MySQL server from a station in a local area netwok 2

Status
Not open for further replies.

lupidol

Programmer
Apr 23, 2008
125
IL
Hello everyone,
MySQL is installed as part of XAMPP on two stations in my home network (So, in fact I have 2 MySQL servers).
All databases, tables and data were created on server1 but now I want o add data to the database on
server1 from server2.
I try to connect to server1 from server2 by inserting the following command from windows7 textual interface
(cmd) of server2:
c:\xampp\mysql\bin mysql -h 10.0.0.26 -u me -pmepass;
and I get the following error message:
ERROR 1045 (28000): Access denied for user 'me'@'server2'.
Can anyone help me with connecting to the remote MySQL data server?
Thanks.
 
Has the user been given access from the the appropriate host?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
The user is me. I connect to the DB I created at server1 with no problems but from the remote - server2 I fail to connect.
Should I give myself access from the remote? How?
 
Set the user host access to '%' (% is a wildcard for all hosts) or to the IP of the machine you want to connect from.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
MYSQL is specific when it comes to locations from where you can connect to it and what you can do when connected from that location. i.e You can have userA have all the privileges and access when connected from a say hostA, but be limited to only Select statements when connecting from hostB for instance.

If you have not done so, you need to add server2 as a valid location from which your user can connect to server1 in MYSQL's user and permission configuration.

I you haven't done so either, I suggest downloading MYSQL Workbench. It helps a lot in administering MYSQL databases visually. And it will make adding the correct permissions easier.


If you want to do this through the command line:

Connected to mysql on server1, and issue a GRANT statement.
GRANT [privileges_to_grant] ON [databasename].* TO 'someuser'@'somehost';

Where [somehost] is server2's name or IP address.






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Thanks a lot !
I'll try to do as you advised me to do !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top