MySQL学习之路4-数据的导入导出

数据的导入

  • 通过数据库管理工具,先建表,然后导入表记录。
  • 通过sql语句导入:

    load data local infile '表路径' into table stuscore
    fields terminated by ',' lines terminated by '\r\n';

数据的导出

  • 通过数据库管理工具,选择导出格式、位置。
  • 通过sql语句导出:

    select * from stuinfo into outfile '导出位置'
    fields terminated by ',' lines terminated by '\r\n';

若Mac通过sql导入导出数据时报错,参考:https://www.cnblogs.com/fuyusheng/p/11110643.html

2020-03-09 21:02

猜你喜欢

转载自www.cnblogs.com/fuyusheng/p/12451513.html