校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > MySQL數據庫導入導出數據之報錯解答實例講解

MySQL數據庫導入導出數據之報錯解答實例講解

熱門標簽:百應電話機器人優勢 電話外呼系統改號 武漢網絡外呼系統服務商 外呼系統打電話上限是多少 怎樣在地圖標注銷售區域 地圖標注費用是多少 南昌三維地圖標注 啥是企業400電話辦理 曲靖移動外呼系統公司

導出數據

報錯

SHOW VARIABLES LIKE "secure_file_priv";
查看默認導出目錄
mysql> SELECT * FROM student INTO OUTFILE "G:\ProgramData\MySQL\MySQL Server 8.0\Uploads\student.txt";
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

解決方法

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數據庫導入導出數據之報錯解答內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • mysql導入csv的4種報錯的解決方法
  • 解決navicat遠程連接mysql報錯10038的問題
  • Navicat Premiun遠程連接MySQL報錯10038解決方案
  • 解決Navicat Premium 連接 MySQL 8.0 報錯"1251"的問題分析
  • mysql 主從復制如何跳過報錯
  • IDEA鏈接MySQL報錯08001和連接成功后不顯示表的問題及解決方法
  • Mysql表創建外鍵報錯解決方案

標簽:隨州 甘南 錦州 荊州 滄州 資陽 黑河 吉林

巨人網絡通訊聲明:本文標題《MySQL數據庫導入導出數據之報錯解答實例講解》,本文關鍵詞  MySQL,數據庫,導入,導出,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《MySQL數據庫導入導出數據之報錯解答實例講解》相關的同類信息!
  • 本頁收集關于MySQL數據庫導入導出數據之報錯解答實例講解的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 务川| 平武县| 吉水县| 扶沟县| 丹阳市| 阿鲁科尔沁旗| 兴文县| 丰县| 灌阳县| 高雄县| 江油市| 栾川县| 策勒县| 海丰县| 东丽区| 石阡县| 桐庐县| 舞阳县| 白城市| 红桥区| 南宁市| 延长县| 苏尼特右旗| 萍乡市| 河曲县| 宜兰市| 阿城市| 稻城县| 怀安县| 琼结县| 延长县| 克山县| 曲周县| 新龙县| 木里| 广汉市| 英超| 财经| 柳河县| 岗巴县| 东方市|