[Haskell-cafe] a question about Database.HDBC.ODBC

2008-09-17 Thread Changying Li
I want to use hdbc to connect my mysql test db. so I set up my
/etc/odbcinst.ini :
[MySQL]
Description = ODBC Driver for MySQL
Driver  = /usr/lib/libmyodbc.so
Setup   = /usr/lib/libodbcmyS.so
FileUsage   = 1

and /etc/odbc.ini:
[test]
Description = MySQL database test
Driver  = MySQL
Server  = localhost
Database= test
Port= 3306
User= root
Socket  = /tmp/mysql.sock
Option  =
Stmt=

user [EMAIL PROTECTED] must use password to connect mysql. other users needn't.
I connect db like this:
Prelude Database.HDBC.ODBC Database.HDBC handleSqlError (connectODBC 
DSN=test)
*** Exception: user error (SQL error: SqlError {seState = [\HY000\], 
seNativeError = -1, seErrorMsg = connectODBC/sqlDriverConnect: [\1045: 
[unixODBC][MySQL][ODBC 3.51 Driver]Access denied for user 'chylli'@'localhost' 
(using password: NO)\]})
Prelude Database.HDBC.ODBC Database.HDBC handleSqlError (connectODBC 
DSN=test;UID=chylli)
Prelude Database.HDBC.ODBC Database.HDBC 

in another term:
mysql show processlist;
++-+---+--+-+--+---+--+
| Id | User| Host  | db   | Command | Time | State | Info   
  |
++-+---+--+-+--+---+--+
| 31 | chylli¶è | localhost | test | Sleep   | 1483 |   | NULL 
| 
| 43 | root| localhost | test | Sleep   |  116 |   | NULL   
  | 

my question is:
1. why not HDBC.ODBC use configuration in /etc/odbc.ini ? if is use,
then connectODBC DSN=test should use root as user without password and
it should succeed.

2. when using UID=chylli, why the user in 'show processlist' is not
chylli but 'chylli¶è' ?  if it use account 'chylli', that connection
should fail. but in fact it succeed !!!



-- 

Thanks  Regards

Changying Li

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] a question about Database.HDBC.ODBC

2008-09-17 Thread Mads Lindstrøm
Hi,

Changying Li wrote:
 I want to use hdbc to connect my mysql test db. so I set up my
 /etc/odbcinst.ini :
 [MySQL]
 Description = ODBC Driver for MySQL
 Driver  = /usr/lib/libmyodbc.so
 Setup   = /usr/lib/libodbcmyS.so
 FileUsage   = 1
 
 and /etc/odbc.ini:
 [test]
 Description = MySQL database test
 Driver  = MySQL
 Server  = localhost
 Database= test
 Port= 3306
 User= root
 Socket  = /tmp/mysql.sock
 Option  =
 Stmt=
 
 user [EMAIL PROTECTED] must use password to connect mysql. other users 
 needn't.
 I connect db like this:
 Prelude Database.HDBC.ODBC Database.HDBC handleSqlError (connectODBC 
 DSN=test)
 *** Exception: user error (SQL error: SqlError {seState = [\HY000\], 
 seNativeError = -1, seErrorMsg = connectODBC/sqlDriverConnect: [\1045: 
 [unixODBC][MySQL][ODBC 3.51 Driver]Access denied for user 
 'chylli'@'localhost' (using password: NO)\]})
 Prelude Database.HDBC.ODBC Database.HDBC handleSqlError (connectODBC 
 DSN=test;UID=chylli)
 Prelude Database.HDBC.ODBC Database.HDBC 
 
 in another term:
 mysql show processlist;
 ++-+---+--+-+--+---+--+
 | Id | User| Host  | db   | Command | Time | State | Info 
 |
 ++-+---+--+-+--+---+--+
 | 31 | chylli¶è | localhost | test | Sleep   | 1483 |   | NULL
  | 
 | 43 | root| localhost | test | Sleep   |  116 |   | NULL 
 | 
 
 my question is:
 1. why not HDBC.ODBC use configuration in /etc/odbc.ini ? if is use,
 then connectODBC DSN=test should use root as user without password and
 it should succeed.

Are you sure it is a HDBC and not a ODBC-library problem? It seems that
you use unixODBC and can then try the command:

  isql test

which will connect though unixODBC without involving HDBC. If you still
have the same problems, then it must be unrelated to HDBC.

 
 2. when using UID=chylli, why the user in 'show processlist' is not
 chylli but 'chylli¶è' ?  if it use account 'chylli', that connection
 should fail. but in fact it succeed !!!
 
 
 

Greetings,

Mads Lindstrøm



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe