Ubuntu under MySQL, initialize data table by loading TXT file

Source: Internet
Author: User

Environment: ubuntu12.04 MySQL (via apt installation)

(1) According to the attribute column in the data table, corresponding to construct the record in the TXT (one row corresponds to a record), the different attributes through the TAB key (takes the init.txt which constructs under the/root directory as an example);

(2) After the establishment of a TXT file, the direct download of the membership error occurred

One reason: Local is for the client, the default local can only load the txt file on the server , it was directly tested on the server, so remove the local, Run the command again

Error 13: Check the online information, is not enough root authority, in order to avoid some trouble, directly through the chmod 777/root-r to the root of the permissions to modify;

Error 29: Check the online information, mysqld forced encoding, the file does not have write permissions, the root path is not added to the/etc/apparmor.d/usr.sbin.mysqld file, so through the gedit/etc/ The APPARMOR.D/USR.SBIN.MYSQLD command will

/root R,

/root/* RW,

Add to file, reload

(3) Finally run the load data infile '/root/init.txt ' into table CT and successfully insert the record into the data table;

(4) through select * from CT; view inserted record contents

Ubuntu under MySQL, initialize data table by loading TXT file

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.