Home  >  Article  >  Database  >  MySQL学习的一些认识笔记

MySQL学习的一些认识笔记

WBOY
WBOYOriginal
2016-06-07 16:51:401082browse

MySQL也是分客户端和服务器两部分安装,当装好MySQL服务器和客户端之后就面临数据库中的表,数据库中表的结构之间的导入和导出问题

MySQL也是分客户端和服务器两部分安装,当装好MySQL服务器和客户端之后就面临数据库中的表,数据库中表的结构之间的导入和导出问题,,现在用过的一些SQL命令:

>MySQL -u busiusr -p 进入MySQL数据库

>set names gbk ;

MySQLdump -uroot newdrmdb tacts >tacts.sql 把库newdrmdb中的表tacts的数据导出;

source 绝对路径/*.sql 把数据导入到表中去 ;

MySQL -uroot -pheli098

select * from tmonthfees limit 1000 into outfile '/*.csv' fields terminated by ', ' ; 从tmonthfees表中导出1000条记 录到文件中 ;
load data local infile ' ' into table table_name fields terminated by ',' ; 把文件中的数据导入到表中去;

delete from tmonthfees;
delete from tusers;
delete from tusersongs;
delete from tsubscribers;

load data local infile 'C:/sql/tmonthfees.13911629339.txt' into table tmonthfees fields terminated by ',';
load data local infile 'C:/sql/tusers.13911629339.txt' into table tusers fields terminated by ',';
load data local infile 'C:/sql/tusersongs.13911629339.txt' into table tusersongs fields terminated by ',';
load data local infile 'C:/sql/tsubscribers.13911629339.txt' into table tsubscribers fields terminated by ',';

导入文本文件中的数据到数据库中的表; 

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn