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.
本文来自博客园,作者:{Zeker62},转载请注明原文链接:https://www.cnblogs.com/Zeker62/p/15046195.html