1.登录Linux
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】
①路径/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.导入待更新
原文:https://www.cnblogs.com/stuka/p/11321256.html