mxODBC and MySQL access to remote DB

M.-A. Lemburg mal at lemburg.com
Tue Jul 6 11:08:14 EDT 1999


Joachim Schmitz wrote:
> 
> Hello,
> 
> I´m trying to connect from a linux-box with mxODBC to a MySQL db on a
> remote SUN. I can access the db with mysql-client from linux. I can also
> connect with the odbctool from the iodbc-mysql package.
> 
> When I try it with mxODBC.iODBC, which uses the same "iodbc.ini" I always
> get this:
> 
> line: 38
> -- in file: Form.py; function: __init__; line: 40
> arg #0 = DSN=immobilien;UID=perry;PWD=pwpwpwpw
> Traceback (innermost last):
>   File "immoform.py", line 153, in ?
>     ,DBtype="MySQL")
>   File "Form.py", line 45, in __init__
>     ,"pw="+self.pw)^M
> mxODBC.OperationalError: ('S1000', 1045, "[TCX][MyODBC]Access denied for
> user: 'user=perry at localhost' (Using password: YES)", 4237)

This a problem with MySQL, not mxODBC. Please check the MySQL
logs for more detailed information about access failures.
 
> The iodbc.ini entry looks like this:
> 
> [immobilien]
> Trace    = Off
> TraceFile= stderr
> Driver   = /usr/lib/mysql/libmyodbc_mysql.so
> DSN      = immobilien
> SERVER   = test.ac-copy.net
> UID      =
> PWD      =
> PORT     = 3306
> #OPTION  = 1
> #DB      = test
> #SOCKET  = /tmp/mysql.sock

Note that I have a line stating the database in my odbc.ini
file:

[mysql]
DRIVER   = /usr/local/lib/libmyodbc.so
SERVER   = localhost
DATABASE = test 

Also note that iODBC switched from using a file named 'iodbc.ini'
to 'odbc.ini' recently.

> with:
> 
> odbctool -u perry -p pwpwpwpw -d immobilien "show tables"
> <table border=1>
> <th>Tables in immobilien</th>
> <tr>
> <td>IMMOAUFTRAG</td>
> </tr>
> <tr>
> <td>IMMOKUNDE</td>
> </tr>
> </table>

Cheers,
-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   178 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/






More information about the Python-list mailing list