Using Windows7, MySql Workbench 5.2 CE, MySql 5.5
I'm trying to import CSV data into Workbench. Note that the CSV is in the same directory as the utilities I've tried so there are no path issues.
I tried first with "mysqlimport" from from the mysql cmd line with no errors, with the table already prepared for the data, but nothing happens--it just drops to the next cmd line. The statement used is: [mysqlimport database1 main.cvs]
I'm trying now with "mysqldbimport" from the Workbench Utilities. However, it does not allow me to specify an existing database, therefore if I create the definitions and then try to import the data I get an error on the INSERT statement to the effect that everything is right in the statement (all the elements show up) except it's leaving out the tablename (which is already in the command itself--shown below).
So, without being able to specify the existing database, I can only get it to create a database called "None." Without an "--import" specification, it say's it imported the definitions (does not import data). If I specify "import=data" before or after "None" is created it outputs the data to the screen and does not put it in the new database. If the "None" database is already there it sometimes gives me an error regarding the CREATE statement, depending on the "--import" parameter. The statements I've attempted look like this:
mysqldbimport --server=root:mypassword@localhost:3306 main.csv (imports definitions)
mysqldbimport --server=root:mypassword@localhost:3306 --import=both main.csv (prints data to the screen)
And I've tried several other similar commands. Sometimes I have to drop the "None" database to start over. Also, when it says its created the definitions, the database "None" appears but there are no tables actually listed (in this case there should be one called "main").
First, I don't understand why it prints the data to the screen. Second, I feel like it might work if I could tell it which database to put the "main.csv" data into, to avoid the INSERT INTO with no tablename error. My understanding is that the name of the CSV is matched to a table in the new or existing database (the way it's supposed to work with mysqlimport).
Any suggestions. I can't find any good information on the net. This is day 3.
I'm trying to import CSV data into Workbench. Note that the CSV is in the same directory as the utilities I've tried so there are no path issues.
I tried first with "mysqlimport" from from the mysql cmd line with no errors, with the table already prepared for the data, but nothing happens--it just drops to the next cmd line. The statement used is: [mysqlimport database1 main.cvs]
I'm trying now with "mysqldbimport" from the Workbench Utilities. However, it does not allow me to specify an existing database, therefore if I create the definitions and then try to import the data I get an error on the INSERT statement to the effect that everything is right in the statement (all the elements show up) except it's leaving out the tablename (which is already in the command itself--shown below).
So, without being able to specify the existing database, I can only get it to create a database called "None." Without an "--import" specification, it say's it imported the definitions (does not import data). If I specify "import=data" before or after "None" is created it outputs the data to the screen and does not put it in the new database. If the "None" database is already there it sometimes gives me an error regarding the CREATE statement, depending on the "--import" parameter. The statements I've attempted look like this:
mysqldbimport --server=root:mypassword@localhost:3306 main.csv (imports definitions)
mysqldbimport --server=root:mypassword@localhost:3306 --import=both main.csv (prints data to the screen)
And I've tried several other similar commands. Sometimes I have to drop the "None" database to start over. Also, when it says its created the definitions, the database "None" appears but there are no tables actually listed (in this case there should be one called "main").
First, I don't understand why it prints the data to the screen. Second, I feel like it might work if I could tell it which database to put the "main.csv" data into, to avoid the INSERT INTO with no tablename error. My understanding is that the name of the CSV is matched to a table in the new or existing database (the way it's supposed to work with mysqlimport).
Any suggestions. I can't find any good information on the net. This is day 3.