mysql ERROR 1148 (42000)错误

3330阅读 0评论2014-05-22 action08
分类:Mysql/postgreSQL


点击(此处)折叠或打开

  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>
这个问题是客户端的问题,但也不是什么大问题。写下了,省得下次再查文档
上一篇:体验ubuntu大版本升级1210-1304
下一篇: linux flash chrome issue: The China firewall is a shame