Chinaunix首页 | 论坛 | 博客
  • 博客访问: 149885
  • 博文数量: 29
  • 博客积分: 1662
  • 博客等级: 上尉
  • 技术积分: 327
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-13 18:53
个人简介

thanks

文章分类
文章存档

2022年(1)

2017年(1)

2016年(1)

2015年(3)

2014年(9)

2011年(1)

2009年(1)

2008年(12)

我的朋友

分类: Mysql/postgreSQL

2014-05-22 18:50:15


点击(此处)折叠或打开

  1. mysql> LOAD DATA LOCAL INFILE '/home/shell/log.txt' INTO TABLE pet;
  2. ERROR 1148 (42000): The used command is not allowed with this MySQL version
  3. mysql>
  4. mysql>



解决办法
http://dev.mysql.com/doc/refman/5.5/en/load-data-local.html

点击(此处)折叠或打开

  1. root@mh3:~# mysql -proot --local-infile=1
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 45
  4. Server version: 5.5.37-0ubuntu0.12.04.1 (Ubuntu)

  5. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

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

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

  10. mysql>
  11. mysql> LOAD DATA LOCAL INFILE '/home/shell/log.txt' INTO TABLE pet;
  12. ERROR 1046 (3D000): No database selected
  13. mysql> use test;
  14. Reading table information for completion of table and column names
  15. You can turn off this feature to get a quicker startup with -A

  16. Database changed
  17. mysql> LOAD DATA LOCAL INFILE '/home/shell/pet.txt' INTO TABLE pet;
  18. Query OK, 8 rows affected, 7 warnings (0.17 sec)
  19. Records: 8 Deleted: 0 Skipped: 0 Warnings: 7

  20. mysql>
  21. mysql>
这个问题是客户端的问题,但也不是什么大问题。写下了,省得下次再查文档
阅读(3217) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~