#208 the connect doesn't use the port specified

MySQLdb-1.2
closed
MySQLdb (285)
5
2012-09-19
2006-09-08
sean_01
No

Im trying toinstall 'trac' - bugtracker which relies
onthe MySQLdb module in python.

it reports that my 'server is to old to support set
charset'

I have two mysql's running
4.0.20 on port 3306
5.1.17 on port 3305

I realise 4.0.20 is too old but mysql5 isn't.

when i specify the port it doesn't seem to be used.

mgood@virgil:~$ python
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.

import MySQLdb
cnx = MySQLdb.connect(host='your_host',
user='your_user', passwd='your_password')
cnx.get_server_info()
'4.0.20'

cnx = MySQLdb.connect(host='localhost',port=0000)
cnx.get_server_info()
'4.0.20'
cnx = MySQLdb.connect(host='localhost',port=3305)
cnx.get_server_info()
'4.0.20'
cnx = MySQLdb.connect(host='localhost',port=3306)
cnx.get_server_info()
'4.0.20'

Discussion

  • Andy Dustman

    Andy Dustman - 2006-09-08

    Logged In: YES
    user_id=71372

    The MySQL client libraries treat host="localhost" specially
    and uses a UNIX socket, regardless of port setting. Try
    using 127.0.0.1 instead or specify the unix_socket parameter
    instead of port (presumably both servers are listening on a
    UNIX socket, check your MySQL configuration to find out where).

    http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html

     
  • sean_01

    sean_01 - 2006-09-11

    Logged In: YES
    user_id=1592559

    Thanks that got me over the first hurdle.

    Now I get error:
    OperationalError: (1251, 'Client does not support
    authentication protocol requested by server; consider
    upgrading MySQL client')
    Failed to initialize environment. 1

    my default system set up is for mysql4.0.20 ie /usr/bin
    /usr/lib /etc/my.cnf are all set up to point to mysql4.
    i have mysql5 in /opt/mysql5.1.17 is there a simple way to
    make MySQLdb use the alternate mysql programs to connect.

    I tried as a quick fix to make a link:
    /usr/bin/mysql->/opt/mysql5.1.17/bin/mysql
    and another link:
    /etc/my.cnf->/etc/mysql/mysql5.cnf

    but this didn't seem to be enough

    thanks in advance

    Sean

     
  • Andy Dustman

    Andy Dustman - 2006-09-11

    Logged In: YES
    user_id=71372

    Check the output of MySQLdb.get_client_info() and make sure
    it is linked against the right version. Also, you may be
    able to change your 5.1 server's configuration to use the
    older authentication mode.

    http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

     
  • sean_01

    sean_01 - 2006-09-11

    Logged In: YES
    user_id=1592559

    Excellant, thanks so very much for your help on this.

    Everything now works as expected.

    So thanks aagin, it was really appreciated.

    Cheers
    Sean

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks