excel to mysql
TRANSCRIPT
Excel to MySQL
There may be a time when you need to create a table in MySQL and feed it with data, with this data coming from another database or combined data source.
We have created a walkthrough of importing an Excel document to MySQL - so get started today!
For the example we'll be using the an excel file on rental boats.
Excel to MySQL
Open your Excel file and click Save As. Choose to save it as a .CSV (Comma Separated) file.
Note that if you are running Excel on a Mac you will need to save the file as a Windows Comma Separated (.csv) or CSV (Windows) to maintain the correct formatting.
Save as a CSV
Create a database
Log into your MySQL shell and create a database. For this example the database will be named boatdb. Note that the --local-infile option is needed by some versions of MySQL for the data loading we'll do in the following steps.
Define the schema
Next we'll define the schema for our boat table using the CREATE TABLE command. For more details you can read the mysql documentation or take what you need from the following example.
Verify your table
Run show tables to verify that your table was created
Load the data
Now that there is a database and a table setup, the data can be imported with the LOAD DATA command.
Visualize it!
If you are a Chartio user you can connect the MySQL database to Chartio and chart away.