135

数据导入导出-夜流璃雨-51CTO博客

 6 years ago
source link: http://blog.51cto.com/13399294/2067075
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
SQL数据导入基本用法格式:load data infile "导入/导出使用的目录名/文件名" into table 库.表名 fields terminated by "字段间隔符号" lines terminated by "\n";注意事项:1.字符按分隔符要与文件内容的一致。2.指定导入文件的绝对路径。3.导入数据的表字段类型要与文件字段匹配。4.禁用SElinux 例: 1.把文件的内容存储复制到导入/导出使用的目录。 #cp /etc/passwd /var/lib/mysql-files/ 2.创建表字段类型要与文件字段匹配。 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)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK