INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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.

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

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

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

(OP)
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?

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

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

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

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.

https://www.mysql.com/products/workbench/

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.

http://dev.mysql.com/doc/refman/5.7/en/grant.html





----------------------------------
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

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

(OP)
Thanks a lot !
I'll try to do as you advised me to do !

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close