Support » Plugins » using exec to import mysql database

  • Hi guys,

    I want to import some tables with sql file in the plugin installation
    exec(‘mysql -h db_host -u db_user -p password db_name < data.sql’,
    $output, $return_var);

    but $return_var is 127 and I have no clue why?!!

    I changed file permissions and change php safe_mode but still not working. and I can run other simple commands like ls, and also I can run this command from outside of wordpress but not inside.

    please help, thank you

Viewing 1 replies (of 1 total)
  • ok I solved it but there is still another problem .

    I needed to add complete path to be able to run mysql –> /usr/local/mysql/bin/mysql

    but how can I know complete path in every computer that runs my plugin ?

Viewing 1 replies (of 1 total)
  • The topic ‘using exec to import mysql database’ is closed to new replies.