Connecting to MySQL database
Mostrar comentarios más antiguos
I am trying to connect to a MySQL database using the Database Toolbox in matlab but I am getting some errors connecting. Please let me know if I have to connect any MySQL connectors.
Database name: ec09249
conn = database ('jdbc:mysql://localhost/ec09249','root','');
curs = exec(conn,'select *from dtm');
curs=fetch(curs);
OUTPUT:
conn =
Instance: 'jdbc:mysql://localhost/ec09249'
UserName: 'root'
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: '[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Please verify that login information and database url are valid.'
Handle: 0
TimeOut: []
AutoCommit: 'off'
Type: 'Database Object'
EDIT: I also tried by loading the MySQL drivers but it vain. conn = database ('ec09249','root','','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/ec09249')
1 comentario
Martijn
el 2 de Feb. de 2011
The first syntax you used was definitely not correct. The second attempt looks better but which exact error messages do you receive with the second syntax which you tried?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Database Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!