最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
數(shù)據(jù)導(dǎo)入導(dǎo)出

數(shù)據(jù)導(dǎo)入導(dǎo)出
設(shè)置數(shù)據(jù)導(dǎo)入/導(dǎo)出使用的目錄
1.查看默認(rèn)使用目錄及目錄是否存在。
MySQL>show variables like "secure_file_priv";
secure_file_priv /var/lib/mysql-files/

成都創(chuàng)新互聯(lián)主要業(yè)務(wù)有網(wǎng)站營(yíng)銷策劃、網(wǎng)站制作、做網(wǎng)站、微信公眾號(hào)開發(fā)、微信小程序開發(fā)、H5技術(shù)、程序開發(fā)等業(yè)務(wù)。一次合作終身朋友,是我們奉行的宗旨;我們不僅僅把客戶當(dāng)客戶,還把客戶視為我們的合作伙伴,在開展業(yè)務(wù)的過程中,公司還積累了豐富的行業(yè)經(jīng)驗(yàn)、成都營(yíng)銷網(wǎng)站建設(shè)資源和合作伙伴關(guān)系資源,并逐漸建立起規(guī)范的客戶服務(wù)和保障體系。 

2.修改目錄及查看修改結(jié)果。
#mkdir /abc
#chown mysql /abc
#vim /etc/my.cnf
[mysqld]
....
secure_file_priv="/abc"

#systemctl restart mysqld

mysql>show variables like "secure_file_priv";
secure_file_priv /abc

SQL數(shù)據(jù)導(dǎo)入
基本用法
格式:load data infile "導(dǎo)入/導(dǎo)出使用的目錄名/文件名" into table 庫(kù).表名 fields terminated by "字段間隔符號(hào)" lines terminated by "\n";

注意事項(xiàng):
1.字符按分隔符要與文件內(nèi)容的一致。
2.指定導(dǎo)入文件的絕對(duì)路徑。
3.導(dǎo)入數(shù)據(jù)的表字段類型要與文件字段匹配。
4.禁用SElinux

例:
1.把文件的內(nèi)容存儲(chǔ)復(fù)制到導(dǎo)入/導(dǎo)出使用的目錄。
#cp  /etc/passwd  /var/lib/mysql-files/

2.創(chuàng)建表字段類型要與文件字段匹配。

3.  /etc/passwd 字段分為 用戶名:密碼占位符 :uid :gid :描述信息 :家目錄 :shell

mysql>create database  passwddb;
mysql>create table passwddb.test(
>user char(20),
>password char(1),
>uid int(2),
>gid int(2),
>comment varchat(50),
>homedir  char(30),
>shell char(30),
>index(user)
>);

mysql>desc  passwddb.test;

3.數(shù)據(jù)導(dǎo)入
mysql>oad  data  infile "/var/lib/mysql-files/passwd"  into  table passwddb.test  fields  terminated by ":"  lines  terminated by "\n";

4.可以在給表字段添加行號(hào)。
mysql>alter table passwddb.test add id int(2) zerofill primary key auto_increment first;  //(zerofil以0補(bǔ)位)

5.查看
mysql>select id,name,uid  from  passwddb.test;  

SQL數(shù)據(jù)導(dǎo)出
基本用法
格式:select查詢的結(jié)果 into outfile "導(dǎo)入/導(dǎo)出使用的目錄名/取一個(gè)文件名" fields terminated by "分隔符" lines terminated by "\n";

注意事項(xiàng):
1.導(dǎo)出的內(nèi)容由sql查詢語句決定。
2.禁用SElinux。

例:
導(dǎo)出passwddb庫(kù)test表中uid小于100的用戶記錄。
mysql>select * from passwddb.test where uid < 100 into outfile "/var/lib/mysql-files/abc.txt";


文章標(biāo)題:數(shù)據(jù)導(dǎo)入導(dǎo)出
網(wǎng)站路徑:http://fisionsoft.com.cn/article/jgodco.html