+ Reply to Thread
Results 1 to 3 of 3

Using ODBC to connect to remote MySQL server

  1. Using ODBC to connect to remote MySQL server

    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.

  2. Re: Using ODBC to connect to remote MySQL server

    I don't know the isql command, but there are a few things you can try:
    giving UID= and PWD= 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.


  3. Re: Using ODBC to connect to remote MySQL server

    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:
    > I don't know the isql command, but there are a few things you can try:
    > giving UID= and PWD= 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 to Thread