时间:2021-05-24
报错
SHOW VARIABLES LIKE "secure_file_priv";查看默认导出目录解决方法
SELECT * FROM student INTO OUTFILE "G:/ProgramData/MySQL/MySQL Server 8.0/Uploads/student.txt";Query OK, 2 rows affected (0.02 sec)数据展示
报错
mysql> load data local infile 'G:/ProgramData/MySQL/MySQL Server 8.0/Uploads/student.txt' -> into table student(a,b,c);ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides解决方法
mysql> SHOW GLOBAL VARIABLES LIKE 'local_infile';+---------------+-------+| Variable_name | Value |+---------------+-------+| local_infile | OFF |+---------------+-------+1 row in set, 1 warning (0.01 sec)mysql> SET GLOBAL local_infile = true;Query OK, 0 rows affected (0.00 sec)mysql> SHOW GLOBAL VARIABLES LIKE 'local_infile';+---------------+-------+| Variable_name | Value |+---------------+-------+| local_infile | ON |+---------------+-------+1 row in set, 1 warning (0.01 sec)报错
mysql> load data local infile 'G:\ProgramData\MySQL\MySQL Server 8.0\Uploads\student.txt' -> into table student(id,name,score);ERROR 2068 (HY000): LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.解决方法
C:\Users>mysql -uroot -p --local-infile使用这种方法登录报错
mysql> load data local infile 'G:\ProgramData\MySQL\MySQL Server 8.0\Uploads\student.txt' -> into table student(id,name,score);ERROR 2 (HY000): File 'G:ProgramDataMySQLMySQL Server 8.0Uploadsstudent.txt' not found (OS errno 2 - No such file or directory)解决方法
mysql> load data local infile 'G://ProgramData/MySQL/MySQL Server 8.0/Uploads/student.txt' -> into table student(id,name,score);Query OK, 8 rows affected, 2 warnings (0.01 sec)Records: 10 Deleted: 0 Skipped: 2 Warnings: 2结果展示
mysql> select *from student;+------+------+-------+| id | name | score |+------+------+-------+| 1 | zs | 100.0 || 2 | zlh | 100.0 || 3 | cyx | 99.1 || 4 | xjj | 90.0 || 5 | aa | 100.0 || 6 | alk | 20.1 || 7 | zml | 11.1 || 8 | djh | 98.0 || 9 | cc | 100.0 || 10 | pp | 20.0 |+------+------+-------+10 rows in set (0.00 sec)到此这篇关于MySQL数据库导入导出数据之报错解答实例讲解的文章就介绍到这了,更多相关MySQL数据库导入导出数据之报错解答内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
MySQL数据库的导入导出相信很多人都接触过,但是大量数据的导入导出就给MySQL数据库导入导出工作提高了难度,接下来就为大家讲解实现MySQL数据库导入导
Python从MySQL数据库中导出csv文件处理csv文件导入MySQL数据库importpymysqlimportcsvimportcodecsdefget
很多时候,我们会遇到需要将本机数据库数据导出或者其他数据库数据的导入操作,那么究竟该如何操作呢?本文将介绍MySQL数据的导出与导入,下面以heidisql工具
MySQL数据库source命令详解及实例MySQL数据库source命令,该命令是数据库导入命令。source命令的用法非常简单,首先你需要进入MySQL数据
本文实例讲述了mysql实现查询结果导出csv文件及导入csv文件到数据库操作。分享给大家供大家参考,具体如下:mysql查询结果导出csv文件:selectl