mysql error :解决无法把文件写入的问题

error:

LOAD DATA LOCAL INFILE '/home/yzp/文档/pet.txt' INTO TABLE pet;
ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides.

try first:

 set global local_infile=1;
Query OK, 0 rows affected (0.00 sec)
mysql> LOAD DATA LOCAL INFILE '/home/yzp/文档/pet.txt' INTO TABLE pet;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Connection id:    8
Current database: mydatabase

ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides

failed

try again:

root@yzp-KLV-WX9:/home/yzp/下载# mysql --local-infile=1 -u root -p;
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.25 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use database;
ERROR 1049 (42000): Unknown database 'database'
mysql> use mydatabase;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> LOAD DATA LOCAL INFILE '/home/yzp/文档/pet.txt' INTO TABLE pet;
Query OK, 1 row affected, 6 warnings (0.01 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 6

well,success.

posted @ 2021-05-17 17:05  Zeker62  阅读(412)  评论(0编辑  收藏  举报