dbTalk Databases Forums  

Using ODBC to connect to remote MySQL server

comp.databases.mysql comp.databases.mysql


Discuss Using ODBC to connect to remote MySQL server in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lardy
 
Posts: n/a

Default Using ODBC to connect to remote MySQL server - 07-31-2006 , 08:34 AM






Hi,

I have two computers on an LAN. I am trying to connect a client
computer to the MySQL server. I have installed unixODBC and
mysql-connector-odbc-3.51.12-1 on the server, configured /etc/odbc.ini,
and can connect successfully to a database via the isql command. On the
client computer I have also installed unixODBC and
mysql-connector-odbc-3.51.12-1, configured /etc/odbc.ini, but can't
connect to the MySQL server via the isql command. There are no
firewalls involved.

Details:
Server - 10.1.1.x
Client - 10.1.1.y

/etc/odbc.ini (server)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = localhost
Database = contacts
Port = 3306

/etc/odbc.ini (client)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = 10.1.1.x
Database = contacts
Port = 3306

Command:
isql MySQL-connect -v username password

Error messages:
[S1T00][unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to MySQL server
on '10.1.1.x' (111)
[ISQL]ERROR: Could not SQLConnect

Could anyone please tell me what I have overlooked?

Lardy.

Reply With Quote
  #2  
Old   
Dikkie Dik
 
Posts: n/a

Default Re: Using ODBC to connect to remote MySQL server - 07-31-2006 , 10:46 AM






I don't know the isql command, but there are a few things you can try:
giving UID=<user name> and PWD=<password> in the ODBC files (I know you
don't want to, but it is just to see if it makes a difference).
Or puttting the Driver between cury braces:
Driver = {MySQL ODBC 3.51 Driver}

But before you do this, make sure that the user account you use is
permitted to be connected remotely. If you created a user
'guest'@'localhost', for example, you can only connect from the local
machine. See the GRANT command's help for more info.

Best regards

Lardy wrote:
Quote:
Hi,

I have two computers on an LAN. I am trying to connect a client
computer to the MySQL server. I have installed unixODBC and
mysql-connector-odbc-3.51.12-1 on the server, configured /etc/odbc.ini,
and can connect successfully to a database via the isql command. On the
client computer I have also installed unixODBC and
mysql-connector-odbc-3.51.12-1, configured /etc/odbc.ini, but can't
connect to the MySQL server via the isql command. There are no
firewalls involved.

Details:
Server - 10.1.1.x
Client - 10.1.1.y

/etc/odbc.ini (server)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = localhost
Database = contacts
Port = 3306

/etc/odbc.ini (client)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = 10.1.1.x
Database = contacts
Port = 3306

Command:
isql MySQL-connect -v username password

Error messages:
[S1T00][unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to MySQL server
on '10.1.1.x' (111)
[ISQL]ERROR: Could not SQLConnect

Could anyone please tell me what I have overlooked?

Lardy.

Reply With Quote
  #3  
Old   
Lardy
 
Posts: n/a

Default Re: Using ODBC to connect to remote MySQL server - 07-31-2006 , 11:21 AM



Thanks for your input Dikkie. I just worked out the solution about 5
minutes before you posted, but you beat me to this post.

The important bit of information that I neglected to include in my
original post was that I had installed MySQL 4.1.12 from the Mandriva
2006Free distribution. I had inspected the /etc/my.cnf for the
--skip-networking option but it was clear. After some Googling I found
this page
(http://dev.mysql.com/doc/refman/5.1/...to-server.html)
and a comment from Jeff Crowe that pointed me in the right direction.
With this particular installation you must comment out the
MYSQLD_OPTIONS="--skip-networking" from /etc/sysconfig/mysqld.

Lardy.



Dikkie Dik wrote:
Quote:
I don't know the isql command, but there are a few things you can try:
giving UID=<user name> and PWD=<password> in the ODBC files (I know you
don't want to, but it is just to see if it makes a difference).
Or puttting the Driver between cury braces:
Driver = {MySQL ODBC 3.51 Driver}

But before you do this, make sure that the user account you use is
permitted to be connected remotely. If you created a user
'guest'@'localhost', for example, you can only connect from the local
machine. See the GRANT command's help for more info.

Best regards

Lardy wrote:
Hi,

I have two computers on an LAN. I am trying to connect a client
computer to the MySQL server. I have installed unixODBC and
mysql-connector-odbc-3.51.12-1 on the server, configured
/etc/odbc.ini, and can connect successfully to a database via the isql
command. On the client computer I have also installed unixODBC and
mysql-connector-odbc-3.51.12-1, configured /etc/odbc.ini, but can't
connect to the MySQL server via the isql command. There are no
firewalls involved.

Details:
Server - 10.1.1.x
Client - 10.1.1.y

/etc/odbc.ini (server)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = localhost
Database = contacts
Port = 3306

/etc/odbc.ini (client)
[MySQL-connect]
Description = MySQL Database Connector
Driver = MySQL ODBC 3.51 Driver
Server = 10.1.1.x
Database = contacts
Port = 3306

Command:
isql MySQL-connect -v username password

Error messages:
[S1T00][unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to MySQL
server on '10.1.1.x' (111)
[ISQL]ERROR: Could not SQLConnect

Could anyone please tell me what I have overlooked?

Lardy.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.