Hi Folks,

I am having a few issues with a LOAD DATA LOCAL INFILE command. As you
can see by the command below, I am receiving an error 1148. The
documentation states this is generally because I don't have
--enable-local-infile on in both client and server. I have switched it
on via command line below and when I do a show variables on the server,
I see local-infile = ON. I have also tried loose-local-infile in the
my.cnf on both client and server. I have just rebuilt the server
ensuring --enable-local-infile was in the ./configure options.

Both client and server are version 4.0.20 and are on different hosts.
The sql file I am using is

CREATE DATABASE IF NOT EXISTS weblog;

use weblog;

CREATE TABLE IF NOT EXISTS dept
        (department INT PRIMARY KEY,
         main_dept INT NOT NULL,
         description VARCHAR(40));

CREATE TABLE IF NOT EXISTS dns_cache
        (ip_address CHAR(15) NOT NULL PRIMARY KEY,
         hostname VARCHAR(255));

CREATE TABLE IF NOT EXISTS web_rec
        (recnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
         date DATE NOT NULL,
         time TIME NOT NULL,
         source_ip CHAR(15) NOT NULL,
         method CHAR(10) NOT NULL,
         department INT,
         source_port SMALLINT NOT NULL,
         username VARCHAR(255),
         c_ip CHAR(15),
         user_agent VARCHAR(255),
         referrer TEXT,
         last_status SMALLINT,
         last_substatus SMALLINT,
         win32_status SMALLINT,
         sent_bytes INT,
         recv_bytes INT);

CREATE TABLE IF NOT EXISTS UserAgent
        (agentnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
         browser VARCHAR(255),
         description VARCHAR(255));

CREATE TABLE IF NOT EXISTS Referrer
        (Refnum INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
         ref_uri VARCHAR(255),
         hostname VARCHAR(255));

CREATE TABLE IF NOT EXISTS status
        (status INT NOT NULL PRIMARY KEY,
         description VARCHAR(255));

LOAD DATA LOCAL INFILE '/u2/lcscreative/sql_scripts/categories.csv' <---
Line 46, error 1148 occurs here
INTO TABLE dept
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
(main_dept,department,description);

porkribs /u2/lcscreative/sql_scripts $ mysql --enable-local-infile -u
davidl -p <make_web_tables.sql
Enter password:
ERROR 1148 at line 46: The used command is not allowed with this MySQL
version
porkribs /u2/lcscreative/sql_scripts $

Anybody have any ideas on what I've done wrong?

Regards

David Logan
Database Administrator
HP Managed Services
139 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax


Reply via email to