Migrate data from Excel (xlsx file) to MySQL.
-
Change
create.sql
in/path/to/excel2mysql/excel2mysql/settings/sqls/
to your own table schema.-
The table described in
create.sql
will be created if not exist. -
You can drop the old table and create new one by adding force option.
-
-
Change MySQL settings (
database_config.py
) in/path/to/excel2mysql/excel2mysql/settings/
.-
You should change basic database settings. For example, host, port, username, password, database name.
-
You should also change ignored column names whose value will be inserted into table automatically. For example, id, created_at, updated_at.
-
-
Change Excel settings (
excel_config.py
) in/path/to/excel2mysql/excel2mysql/settings/
.- Change the header setting if first line of your excel file is not header row.
-
Make sure you can connect to target MySQL server correctly.
-
Run excel2mysql to do data migration:
Option 1 (recommended):
$ python excel2mysql
Option 2:
$ python -m excel2mysql
Option 3:
$ cd /path/to/excel2mysql/ $ python main.py