0

I have a .sql file (named dbdump.sql) in my current MATLAB directory, and I want to get some data out of it into MATLAB. I believe this should be a straightforward task, and here is what I have so far:

javaaddpath('C:/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar') 
con   =  database('dataarchivetest','', '','com.mysql.jdbc.Driver','./dbdump.sql');
query =  exec(con,'select * from test');

However, when I inspect the con variable, it gives the following message:

'JDBC Driver Error: com.mysql.jdbc.Driver. Driver Not Found/Loaded.'

I also tried the following:

con   =  database('dataarchivetest','', '','C:/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar','./dbdump.sql');
query =  exec(con,'select * from test');

And got a similar message:

JDBC Driver Error: C:/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar. Driver Not Found/Loaded.

I downloaded the MySQL connector from here: http://dev.mysql.com/downloads/mirror.php?id=13597http://dev.mysql.com/downloads/mirror.php?id=13597

I feel I am missing something very simple. Any help would be highly appreciated.

1
  • It won't help you now. But, if you request datadumps in the future and don't want to import them in an sql server, I would recommend requesting a format that you can handle with your existing software. Commented Sep 12, 2013 at 19:05

1 Answer 1

3

The connector connects with an SQL server, not with an SQL file. You should set up a SQL server like PostgreSQL or MySQL (for instance on your localhost) and process queries to it.

Sign up to request clarification or add additional context in comments.

7 Comments

Is there any way to read an sql file without importing it into a database and then connecting to it?
Not as far as I know :(.
Hey, I imported the sql dump into a database and am trying to connect to it, but I keep getting the driver error even though it seems I am doing everything correct, or no?
Can you provide some code (how did you setup the database and made the connection)?
I used the same code as above, but with the following: con = database('fintest','sjb2_finusr', 'pass','com.mysql.jdbc.Driver','web312.webfaction.com:3306/fintest'); where fintest is the database name on a server I have with webfaction.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.