Mysql Error 1148
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring the used command is not allowed with this mysql version php developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question the used command is not allowed with this mariadb version x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; load data local infile mysql 5.5 not allowed it only takes a minute: Sign up How can I correct MySQL Load Error up vote 20 down vote favorite 8 I'm not quite sure a similar question to this was closed by I'm trying to execute the following MySQL
The Used Command Is Not Allowed With This Mysql Version Python
program. mysql -e "load data local infile \ '/tmp/ept_inventory_wasp_export_04292013.csv' into \ table wasp_ept_inv fields terminated by ',' \ lines terminated by '\n' ;" at the bash command line and get this error ERROR 1148 (42000) at line 1: The used command is not allowed with this MySQL version How can I work around this problem? I am actually running this command from a Python program, but pulled the command out to try fiddling with it at the bash command loose-local-infile=1 line. I've seen how I can modify my.cnf (local-infile), but I do not want that global a change if I can avoid it. Here's the MySQL version. mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (i686) using readline 6.2 mysql csv import load local share|improve this question edited Feb 4 at 12:05 shgnInc 96111023 asked Apr 29 '13 at 18:40 octopusgrabbus 5,57772882 add a comment| 4 Answers 4 active oldest votes up vote 26 down vote accepted As documented under Security Issues with LOAD DATA LOCAL: To deal with these problems, we changed how LOAD DATA LOCAL is handled as of MySQL 3.23.49 and MySQL 4.0.2 (4.0.13 on Windows): By default, all MySQL clients and libraries in binary distributions are compiled with the --enable-local-infile option, to be compatible with MySQL 3.23.48 and before. If you build MySQL from source but do not invoke configure with the --enable-local-infile option, LOAD DATA LOCAL cannot be used by any client unless it is written explicitly to invoke mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0). See Section 20.6.6.49, “mysql_options()”. You can disable all LOAD DATA LOCAL statements from the server side by starting mysqld with the --local-infile=0 option. For the mysql command-line client, enable LOAD DATA LOCAL by specifying the --local-infile[=1] option, or disable it with the --local-infile=0 option. For mysqlimport, local data file loading is off by default; enable it with the --local or -L option. In any case, successful use of a local
Connectors More MySQL.com Downloads Developer Zone Section Menu: Documentation Home MySQL 5.7 Reference Manual Preface and Legal Notices General Information Installing and Upgrading MySQL Using MySQL as a Document load data into mysql table from csv Store Tutorial Connecting to and Disconnecting from the Server Entering Queries Creating
Security Issues With Load Data Local
and Using a Database Creating and Selecting a Database Creating a Table Loading Data into a Table Retrieving
Pymysql Local Infile
Information from a Table Selecting All Data Selecting Particular Rows Selecting Particular Columns Sorting Rows Date Calculations Working with NULL Values Pattern Matching Counting Rows Using More Than one http://stackoverflow.com/questions/16285864/how-can-i-correct-mysql-load-error Table Getting Information About Databases and Tables Using mysql in Batch Mode Examples of Common Queries The Maximum Value for a Column The Row Holding the Maximum of a Certain Column Maximum of Column per Group The Rows Holding the Group-wise Maximum of a Certain Column Using User-Defined Variables Using Foreign Keys Searching on Two Keys Calculating Visits Per Day http://dev.mysql.com/doc/mysql/en/loading-tables.html Using AUTO_INCREMENT Using MySQL with Apache MySQL Programs MySQL Server Administration Security Backup and Recovery Optimization Language Structure Globalization Data Types Functions and Operators SQL Statement Syntax The InnoDB Storage Engine Alternative Storage Engines High Availability and Scalability Replication MySQL Cluster NDB 7.5 Partitioning Stored Programs and Views INFORMATION_SCHEMA Tables MySQL Performance Schema MySQL sys Schema Connectors and APIs Extending MySQL MySQL Enterprise Edition MySQL Workbench MySQL 5.7 Frequently Asked Questions Errors, Error Codes, and Common Problems Restrictions and Limits Indexes MySQL Glossary Related Documentation MySQL 5.7 Release Notes Download this Manual PDF (US Ltr) - 35.6Mb PDF (A4) - 35.6Mb PDF (RPM) - 34.6Mb EPUB - 8.7Mb HTML Download (TGZ) - 8.4Mb HTML Download (Zip) - 8.5Mb HTML Download (RPM) - 7.3Mb Eclipse Doc Plugin (TGZ) - 9.3Mb Eclipse Doc Plugin (Zip) - 11.4Mb Man Pages (TGZ) - 202.2Kb Man Pages (Zip) - 307.4Kb Info (Gzip) - 3.3Mb Info (Zip) - 3.3Mb Excerpts from this Manual MySQL Backup and Recovery MySQL Globalization MySQL Information Schema MySQL Installation Guide MySQL and Linux/Unix MySQL and OS X MySQL Partiti
Editor Environment Flash Player Fonts Icons Indicator Install Keyboard Shortcuts Live CD Packages Privacy Settings Themes Window Harden Ubuntu Initial Setup Server Setup Disabled Services Hardening Monitoring Tools Optimization Software Useful Commands Backup http://bookofzeus.com/articles/mysql/mysql-load-data-infile-error-1148 BookOfZeus > articles > mysql MySQL load data infile error 1148 Posted on http://www.markhneedham.com/blog/2011/01/18/mysql-the-used-command-is-not-allowed-with-this-mysql-version/ Saturday May 18, 2013 / by Eric Potvin The MySQL LOAD DATA INFILE can be very useful if you need to import hundreds of thousands of records from a CSV file. It inserts these records in practically no time (few seconds) and mostly if your table structure is correct, you not allowed won't get any errors or warnings. If everything works fine using this kind of command: LOAD DATA INFILE '/path/to/my/data.csv' INTO TABLE db.test FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' But you get the following error message 1148: ERROR 1148 (42000) at line 4: The used command is not allowed with this MySQL version In the used command my version: mysql --version mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (x86_64) using readline 6.2 The fix is easy, and you might need both options (I did). Both resides in the /etc/mysql/my.cnf file. The first one under [mysql] and the second one under [client]. [mysql] local-infile = 1 [client] loose-local-infile=1 Restart Mysql deamon: sudo /etc/init.d/mysql restart Now time for import. You can use the same command in the MySQL client or if you run from the command line you have to specific the --local-infile option. Then once the query is executed, you get something like this: Query OK, 3167348 rows affected (0 min 41.37 sec) Records: 3167348 Deleted: 0 Skipped: 0 Warnings: 0 More links About Articles CodeBase Contribute NewsLetters Sign up for our free newsletter! Unsubscribe from our newsletter Powered by MailChimp © 2011-2016 BookOfZeus All articles, code or tutorials listed on bookofzeus.com can be used as reference, links or as in a sharing matter without attribution. You cannot copy whole tutorials (unless permission is given), either translating to another language. By using and/or reading this site, you agree to our privacy policy and terms and conditions.
5.1.48, for apple-darwin10.4.0 (i386) using readline 6.1 When I try to use the ‘LOAD DATA LOCAL' option to load data into tables I get the following error message: ERROR 1148 (42000) at line 4: The used command is not allowed with this MySQL version Which we can get around by using the following flag as described in the comments of the documentation: mysql --local-infile -uroot -pandsoon Or by putting the following entry in a config file (in my case ~/.my.cnf): [mysql] local-infile I tried a bit of googling to see if I could work out why it happens but I'm still none the wiser. Be Sociable, Share! Tweet Written by Mark Needham January 18th, 2011 at 6:58 pm Posted in Software Development Tagged with mysql « Installing git-svn on Mac OS X Coding: Spike Driven Development » Luke +1 - help me out a bunch Khalid thanks. helped me Mantap thanks very helped… A Guest This was verry helpful! (went for the entry in de my.cnf file) Marcel As you can see here: http://dev.mysql.com/doc/refman/5.5/en/load-data-local.html local-infile is diasbled by default as a security measure. Davidcsi Thanks, also helped me. ravi thanks.. it helped me Pingback: LOAD DATA LOCAL en MySQL | Psep.cl() Amar Helped me…..Thanks diego service mysqld stop mysqld_safe -local-infile=1 work with me Ashish Datta FYI, this also gets around this error if you're using Amazon's RDS service. Qaiser Shakoor Great worked for me 🙂 Twitter Email Subscribe by email Search for: Archives Archives Select Month October 2016 (3) September 2016 (1) August 2016 (4) July 2016 (8) June 2016 (6) May 2016 (2) April 2016 (2) February 2016 (1) January 2016 (2) December 2015 (6) November 2015 (5) October 2015 (6) September 2015 (5) August 2015 (11) July 2015 (17) June 2015 (21) May 2015 (17) April 2015 (16) March 2015 (19) February 2015 (12) January 2015 (9) December 2014 (10) November 2014 (13) October 2014 (11) September 2014 (10) August 2014 (10) July 2014 (10) June 2014 (10) May 2014 (10) April 2014 (10) March 2014 (4) February 2014 (10) January 2014 (10) December 2013 (4) November 2013 (16) October 2013 (14) September 2013 (19) August 2013 (16) Jul