使用 GUI 软件很好操作,下面介绍命令行操作。

  1. 导出
    cmd 命令

mysqldump -hlocalhost -uroot -p student_db > C:\student_db.sql

1.2 导出单个表

mysqldump -hlocalhost -uroot -p student_db student > C:\student_db_student.sql


2. 导入
 导入时需要先创建数据库,然后再导入。
``` mysql
# cmd 登陆数据库
mysql -hlocalhost -uroot -p
-- MySQL 命令
create database student_db character set utf8 collate utf8_general_ci;
use student_db;
-- 导入数据库
source C:\student_db.sql;
--
-- 也可以这样(同样需要先创建数据库):
mysql -uroot -p student_db < student_db.sql

相关文章:

  • 2022-02-18
  • 2021-09-11
  • 2022-02-19
  • 2021-10-24
  • 2022-01-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2021-12-13
  • 2021-09-01
  • 2021-06-18
相关资源
相似解决方案