0

Hi i have this section of code that looks for user info on another table... this code works fine querying the database locally... but i need it to work remotely can anyone see what im doing wrong...

from sqlite3 import dbapi2 as sqlite
    import MySQLdb as mysql
    from mud.common.persistent import Persistent
    pconn = Persistent._connection.getConnection()
    pcursor = pconn.cursor()
    changes = 0
    try:
        conn = mysql.pconnect("2X4.12.XX.XX:3306","whatiXXXX","XXXXXX","whaXXX")
        cursor = conn.cursor()
        cursor.execute("BEGIN;")
    except:
        print "Error connecting to MySQL...."
        reactor.callLater(5, WebSyncTick)
        return

i just get Error connecting to mysql... so i think its a connection issue... no firewall issue either took it down for testing...

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by jice
0

Error connecting to MySQL.... it works on local network localhost but not remotely... i was just using connect instead of pconnect for localhost only change i thought i had to make to go remote

0

"Error connecting to MySQL..." is not the error you have, it is the error you defined, in your try - except block, hiding the mysql error message. So, to know what error you exactly have, you should remove this block or put a "raise" instead of "return".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.