In dealing with LOAD DATA LOCAL INFILE in mysql, as default

If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients

When logging in to mysql by telnet, we can use

mysql -u xxxxxxx -p --local-infile[=1]

to enable the LOAD DATA LOCAL INFILE function, but how can we do this in PHP?

As the PHP function is like this:

resource mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]])

no extra option......

    a year later

    try this

    $fix = mysql_query("SET GLOBAL local_infile=1") or die (mysql_error());
    
    

    but the user needs SUPER Privileges

      Write a Reply...