Saturday, October 4, 2008

Problems with load data

You may be trying to use some features which directly load a database from a file to the database that you are using  like the following


ERROR 1148: The used command is not allowed with this MySQL version




This usually happens if your client or the server is not configured to use the local infile. This  is a pretty common error. I was going through some of the sql commands and came across this one. The typical solution to this one would be use the loose local infile, in the .my.cnf file, which goes something like this




Another solution is if you are starting your mysql  , try and see the mysql –help, it will spew out some of the following help messages



  -g, --no-named-commands

                      Named commands are disabled. Use \* form only, or use

                      named commands only in the beginning of a line ending

                      with a semicolon (;) Since version 10.9 the client now

                      starts with this option ENABLED by default! Disable with

                      '-G'. Long format commands still work from the first

                      line. WARNING: option deprecated; use

                      --disable-named-commands instead.

  -i, --ignore-spaces Ignore space after function names.

  --local-infile      Enable/disable LOAD DATA LOCAL INFILE.

  -b, --no-beep       Turn off beep on error.

  -h, --host=name     Connect to host.

  -H, --html          Produce HTML output.

  -X, --xml           Produce XML output



Try and use the mysql –u root –local-infile=1 and then try to use mysql , you will be able to work on it faster



No comments: