简体   繁体   中英

Trouble exporting Excel data to MySQL

I am attempting to export Excel data into MySQL 8.0 using 'MySQL for Excel' in Excel with datatype VarChar(255).

The longest of my strings is 40 characters, yet I keep on getting the error message:

MySQL Error 1406: Data too long for column 'Column' at row 150

I switched the MySQL mode to not strict in the my.ini file using these instructions , but it didn't resolve the issue.

When I increase the VarChar length to 800, I receive the error message:

MySQL Error 1071: Specified key was too long; max key length is 3072 bytes

Anything lower than VarChar(800) gives me the first error message.

Any ideas how to successfully export the data into MySQL?

I suggestion you to use MysqlWorkbench to import your Excel data file. It's very easy and simple to import data into database, you just need to create database structure first time and then use that widget to import file data into.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM