Notes for learning MySQL

Source: Internet
Author: User

MySQL is installed in two parts: client and server. After the MySQL server and client are installed, the database tables and the table structures in the database are imported and exported, some SQL commands used now:

> MySQL-u busiusr-p enters the MySQL database

> Set names gbk;

MySQLdump-uroot newdrmdb tacts> tacts. SQL exports the table tacts data in the newdrmdb database;

Source absolute path/*. SQL imports data into the table;

MySQL-uroot-pheli098 <... (absolute path); execute the database script in linux;

Select * from tmonthfees limit 1000 into outfile '/*. csv 'fields terminated by', '; export 1000 records from the tmonthfees table to the file;
Load data local infile ''into table table_name fields terminated by ','; import the data in the file to the table;

Delete from tmonthfees;
Delete from tusers;
Delete from tusersongs;
Delete from tsubscribers;

Load data local infile 'C:/SQL/tmonthfees.13942529339.txt 'into table tmonthfees fields terminated ',';
Load data local infile 'C:/SQL/tusers.13942529339.txt 'into table tusers fields terminated ',';
Load data local infile 'C:/SQL/tusersongs.13942529339.txt 'into table tusersongs fields terminated ',';
Load data local infile 'C:/SQL/tsubscribers.13942529339.txt 'into table tsubscribers fields terminated ',';

Import data from text files to tables in the database;

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.