I have a excel file with about 5000 rows to be insersted at one of my mysql databse table, can anyone give quick and dirty solution ? Thanks
相关问题
- sqlyog export query result as csv
- Excel sunburst chart: Some labels missing
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
Quick and dirty:
Put a calculated column in Excel to generate a "insert" statement. Then COPY+PASTE all sentences into MySQL command interpreter.
Your cell should have a formula like this:
Then copy the formula on all the rows and you'll have your script.
Other quick & dirty:
Open your Excel file with ACCESS, then use "Export to ODBC" function to put your data in MySQL. It's a little bit more complicated since you will have to setup your ODBC driver and Connection but if you plan to do this regularly, it might be a better choice.
Have a look at:
You can export the Excel file to a CSV file, then import it to the MySQL database using phpMyAdmin.
Unless you've some additional tools lying around, there is no quick way.
You could write an excel macro and transfer the data via ODBC.
You could export it as CSV then import it using PHPMyAdmin
You could export the CSV then write an awk script to convert the csv data into a set of insert statements
You could use (insert language of choice here)
Do you have an ODBC link? Do you have any programming languages? PHPMyAdmin? Some other MySQL tool?
I have done this in the past by exporting the file as a CSV. Creating your table in MySQL, reading the CSV line by line in PHP and using explode to build your query.
Save as CSV; use the "Import text file" feature of a graphical mySQL client like HeidiSQL to import.