Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

load data problems

aldacoaldaco Member Posts: 5
hello i need to insert some records into a table using load data, but i cant. i have this line un my php program for that:
$query="load data infile examen.txt into table examen fields terminated by ',' ";
i guess it's a problem with the privileges, but i dont know how to use the FILE privilege.

thanks

Comments

  • JonathanJonathan Member Posts: 2,914
    : hello i need to insert some records into a table using load data, but i cant. i have this line un my php program for that:
    : $query="load data infile examen.txt into table examen fields terminated by ',' ";
    : i guess it's a problem with the privileges, but i dont know how to use the FILE privilege.
    :
    If you don't have the FILE priv you won't be able to do what you just suggested. Privileges are fairly easy to understand - you have users, you have databases, and a user has particular privileges on a certain database. Therefore, you need to grant the user you are connecting as the FILE privilege on the appropriate database containing the table you are trying to load the file into.

    Also, I think you'd need to specify and absoloute path, not just examen.txt, or MySQL may not know where to find it (because it won't share a CWD with your PHP script).

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.