Heim  >  Artikel  >  Datenbank  >  MySQL学习的一些认识笔记

MySQL学习的一些认识笔记

WBOY
WBOYOriginal
2016-06-07 16:51:401142Durchsuche

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn