2. 登录 MySQL:MySQL -h192.168.1.1 -uroot -p123123 [h - 服务器 IP,u - 用户名, p - 密码]
3.use mysqldemo; [切换到表数据所在库]
3.select * into outfile '/var/lib/mysql-files/demo.sql' from demo_table; [把 demo_table 查询的结果输出到 / var/lib/MySQL-files/demo.sql]
1路径 / var/lib/MySQL-files / 是因为若不指定则会报错: ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement,
show variables like '%secure%'; [其他目录对 MySQL 的权限限制, 只能输出到默认]
- +--------------------------+-----------------------+
- | Variable_name | Value |
- +--------------------------+-----------------------+
- | require_secure_transport | OFF |
- | secure_auth | ON |
- | secure_file_priv | /var/lib/MySQL-files/ |
- +--------------------------+-----------------------+
4. 导入待更新
来源: http://www.bubuko.com/infodetail-3148285.html