TXT import MySQL

Source: Internet
Author: User

1. Modify the character encoding and modify it all to GBK.

 like ' %char% ' ; set character_set_database=GBK;

Among them, Character_set_client is the client-side encoding method, Character_set_connection is used for establishing the connection encoding; character_set_database database encoding; character_set_ Results the encoding of the result set; the encoding of the Character_set_server database server; As long as the above four uses the same encoding method, there will be no garbled problem.

2. Create a database

CREATE SCHEMA ' Kingdee ';

3. Create a table

CREATE TABLE' Kingdee '. ' t0803 ' (' Fproductid ' )VARCHAR( -)NULL, ' Fproductver 'VARCHAR( -)NULL, ' Fproductregno 'VARCHAR( -)NULL, ' Faccountname 'VARCHAR( $)NULL, ' Faccountuser 'VARCHAR( -)NULL, ' Fysuser 'VARCHAR( -)NULL, ' Fadditionalinfo 'VARCHAR( -)NULL, ' Findustry 'VARCHAR( -)NULL, ' fbusiness 'VARCHAR( -)NULL, ' Ffunctionkey 'VARCHAR( -)NULL, ' Foperationcount 'DECIMAL(Ten,0)NULL, ' Foperationday 'DECIMAL( -,0)NULL, ' FIP 'VARCHAR( +)NULL, ' fsenddate 'TIMESTAMP  not NULL DEFAULT Current_timestamp, ' Fappvisitpos 'DECIMAL(4,0)NULL, ' Fversioninfo 'VARCHAR( -)NULL, ' Fuserrole 'VARCHAR( -)NULL, ' Fserveradditionalinfo 'VARCHAR( Max)NULL);

3. Import data

load data local infile "D:/Kingdee/intoTABLEby'  | ';

4. See if the imported data is garbled or not

Select *  from 5;

5. If garbled, delete the table

Drop TABLE t0803;

TXT import MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.