LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   connecting to mysql on linux from windoze (https://www.linuxquestions.org/questions/linux-software-2/connecting-to-mysql-on-linux-from-windoze-409460/)

strimp099 01-29-2006 07:57 PM

connecting to mysql on linux from windoze
 
Hi:
I am interested in connecting to my MySql database that is running (default install) on FC4. I want to connect to the db with my Windoze machine using MySql Query Browser. Both machines are behind a router; the gateway is 192.168.0.1. The Linux ip address is 192.168.0.50 and the windows is 192.168.0.11 (both static). I guess I need to learn how to determine the mysql host and port when connecting. I thought it would just be 192.168.0.50 and 3306 respectively, it's not working. Any ideas?
Thanks

megaspaz 01-29-2006 08:14 PM

you can always connect with the ip address and the default port for mysql is 3306. if you can't connect, check to see if you have port 3306 open on your firewall. you'd have to open up port 3306 in the linux machine with IPtables.

edit: also, when connecting, i believe you need to specify a mysql user and the mysql user's password. At least that's how the older mysql administrator used to work.

strimp099 01-29-2006 09:03 PM

Hi - thanks for the reply.

I ran nmap on my linux machine and 3306 is open:

Code:


[root@furnace ~]# nmap furnace.strimpel.net

Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-01-29 20:58 CST
Interesting ports on furnace.strimpel.net (192.168.0.50):
(The 1658 ports scanned but not shown below are in state: closed)
PORT      STATE SERVICE
22/tcp    open  ssh
80/tcp    open  http
111/tcp  open  rpcbind
3306/tcp  open  mysql
10000/tcp open  snet-sensor-mgmt

Nmap finished: 1 IP address (1 host up) scanned in 0.289 seconds

I am getting the error message 2003:
Can't connect to MySQL server on '192.168.0.50'(10060)

I also tried to log in as user:

root@furnace.strimpel.net

No dice.

sasho 01-29-2006 09:08 PM

Quote:

Originally Posted by strimp099
Hi:
I am interested in connecting to my MySql database that is running (default install) on FC4. I want to connect to the db with my Windoze machine using MySql Query Browser. Both machines are behind a router; the gateway is 192.168.0.1. The Linux ip address is 192.168.0.50 and the windows is 192.168.0.11 (both static). I guess I need to learn how to determine the mysql host and port when connecting. I thought it would just be 192.168.0.50 and 3306 respectively, it's not working. Any ideas?
Thanks

Just to make sure since it wasn't explicitly mentioned: do you have the mysql ODBC drivers already installed on your windows machine?

strimp099 01-29-2006 09:16 PM

I sure don't. I should try that huh?

megaspaz 01-29-2006 09:23 PM

what you need is the mysql administrator for your windows machine.

http://dev.mysql.com/downloads/administrator/index.html

you can set up your hosts and users for that host. it should come with all the drivers necessary.

I don't know much about the query browser or this iteration of administrator as I'm using the old version of administrator on linux.

Gimme a couple of ticks and I can show you screenshots of the mysql control center I'm using. I would imagine the mysql administrator would have similar functionality.

megaspaz 01-29-2006 09:41 PM

Ok. My version of mysql control center has administration and a query browser built in. I'm wondering if you need both the query browser and the mysql administration package. Like, maybe the broke up the components. So what was one package for mysql control center, is now 2 packages - the query browser and mysql administrator.

Administration Window - program start up
Administrator Window - Host set up
Administration Window - Connecting to host
Administration Window - Successful connection. - Notice the computer icon next to sa@tron on left side. It's green instead of red.
Query Browser Window - just some commands

So just check into getting both the query browser and the mysql administrator.

Edit: This is the linux version of mysqlcc. There is a windows version of this, but i think mysqlcc is no longer available from mysql's site for either platform. There should be windows version of the query browser and mysql administrator available though.

accessrichard 01-29-2006 09:52 PM

I don't know anything about the query browser you refer of, but when I install mysql on windows and connect to my linux box I have to make sure I set up the correct priviledges on my linux box, specifically, I make sure to tell mysql that it is ok for a user with a specific ip address to connect to my db using,
$ mysql -u root -p password
mysql> grant all on databasename.* to user@"ipaddress" identified by "user";
mysql> flush privileges;
mysql> quit

megaspaz 01-29-2006 10:00 PM

Quote:

Originally Posted by accessrichard
I don't know anything about the query browser you refer of, but when I install mysql on windows and connect to my linux box I have to make sure I set up the correct priviledges on my linux box, specifically, I make sure to tell mysql that it is ok for a user with a specific ip address to connect to my db using,
$ mysql -u root -p password
mysql> grant all on databasename.* to user@"ipaddress" identified by "user";
mysql> flush privileges;
mysql> quit

Yes, you do need to make sure this is done. This would also be true if you're mysql database was running on windows. Also, if you don't care about which machine the user is attempting to connect from, you can substitute 'ipaddress' in the command quoted to '%'. I think the grant command above is not exactly correct, either. but anyhoo...

example -

user = foo
host = %
password = foobar
databasename = somedatabase

mysql> grant all privileges on somedatabase.* to 'foo'@'%' identified by 'foobar';
mysql> flush privileges;

optionally you can give the user grant options also:

mysql> grant all privileges on somedatabase.* to 'foo'@'%' identified by 'foobar' with grant option;
mysql> flush privileges;

The quotes in the command example are required. You'll usually want to do this twice. one for the any host ('%') and one for localhost ('localhost').

strimp099 01-31-2006 08:54 AM

Thank you for the replies, I will give your suggestions a try and post the results.

strimp099 01-31-2006 04:09 PM

Hey all:

I tried your suggestions, with no avail. It keeps saying the same thing, can't connect. I don't think it is a problem with the permissions, as I would receive an error indicating as such. I think it is a problem with the host.

Shouldn't I just be putting in the IP address of the machine with the MySQL DB (the Linux machine - 192.168.0.50)?

The Query Browser can be found here
http://www.mysql.com/products/tools/


All times are GMT -5. The time now is 12:46 AM.