I’m teaching myself Ruby, and thus far I’ve managed to successfully
attach to and INSERT / SELECT / etc records from a MSSQL server using
the ODBC driver. I’ve been trying to do the same thing with a MySQL
server, using MyODBC set up to connect to the server and database in
question, but whenever I try to then run code against that server I
get an error message.
The code I’m using is:
conn = ODBC::connect(‘MySQLPitOfDespair’)
The error message I’m getting is:
initialize': S1000 (1045) [MySQL] [ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: NO) (ODBC::Error) from 2007-03-13_ConnectMySQLODBC.rb:3:inconnect’
I’m reasonably certain that I’ve created the ODBC connection
correctly, since I can link tables from the MySQL server into a
Microsoft Access database using the ODBC DSN of ‘MySQLPitOfDespair’.
Is there a better way to connect to a MySQL server using Ruby than via
ODBC? Is there a syntax for supplying user and password settings for
the ODBC::connect statement above?
Many thanks for any help!