In the process of data processing, the Excel file under Windows is often imported into MySQL under Linux. There are some problems with this.
1. First, build the table in MySQL. Commands are best available in Notepad and can be modified at any time and executed at any time
null,...);
2. Cut out what you need to import in Excel. Then use the Save As feature of Excel to save as TXT, regardless of whether the encoding is utf-8 or Unicode.
3. But neither Utf-8 nor Unicode,linux/mysql are recognizable and need to be converted into ASIIC. Here I use the notepad++. After opening the file point: Format, to ANSI encoding format. Then save and upload to the Linux machine
4. Note that there may be some cells in Excel that use a soft return (Alt+enter input). These returns are converted into text and will become a true carriage return. So you have to find a way to get rid of them. I used a lookup (input alt+10), but because there are some I need, There was something I didn't need, so I deleted the column I didn't need. The workload is relatively large.
5. You can then import the
' /home/a.txt ' Into TABLE mysql.tablename '\ t'\ n';
Here, \ t represents a tab and is modified according to the file you generated.
Excel file import MySQL