1

I searched for this topic and couldn't find any relevant help. A coworker of mine has MYSQL server set up on a Windows 7 machine. On the same network, I have a machine running Centos 7. I have also installed MariaDB on my machine.

  1. How do I access my coworker's MYSQL database (and any tables in it) from my machine? He has given me the IP address of his machine, the username and password for the database, and the name of the database. We're on the same network and I can ping his IP from the Centos command prompt and get a response.
  2. Do I need to be at the MariaDB prompt on my machine before I can access his MYSQL database? My ultimate goal is to retrieve some data from one of his tables and join it (or manipulate it) to some of the data in one of my tables in my MariaDB database, and he should be able to do the same thing (i.e., access data in my tables in my database). I hope the question is specific enough.
Murchak
  • 183
  • 1
  • 3
  • 17
  • Step 1: Pick a database client. Step 2: Use whatever UI it provides to tell it what server you want to connect to. – Quentin Sep 08 '16 at 18:27
  • Joins across different databases is a different and rather more complicated problem. – Quentin Sep 08 '16 at 18:28

1 Answers1

1

Once you have the CentOS MySQL client installed ( yum install mysql ) . In the Bash shell execute the following:

mysql -u YOUR_MYSQL_USERNAME -p YOUR_MYSQL_PASSWORD -h MYSQL_SERVER_IPADDRESS

You can also omit your password after the -p and it will prompt you for it so it does not get logged in your bash history.

Your coworker may also need to grant access to your host address to the database as explained in the following thread.

https://stackoverflow.com/a/10236195/3006366

Once logged into the server successfully, you will be at a mysql> prompt. From here you can select the database to query use MYDATABASE; then run any queries.

Community
  • 1
  • 1
ode2k
  • 2,653
  • 13
  • 20
  • Alright, so I tried the following: msql -u mycoworker_username -p mycoworker_pass -h mycoworker_server_ipaddress this got me logged into his database. The prompt that I see is MySQL[(none)]> and when I type SHOW databases; I see his databases and tables. But from within this prompt how do I now access my tables? – Murchak Sep 09 '16 at 15:59