Calling MySQL exe using PHP exec doesn't work

后端 未结 6 1100
一整个雨季
一整个雨季 2020-12-20 02:52

I have an extremely simple script with PHP exec, calling mysql command:

  $dbhost = \'localhost\';
  $dbuser = \'root\';
  $dbpass          


        
6条回答
  •  我在风中等你
    2020-12-20 03:28

    I found the solution

    The problem is that you need to explicitly enclosed the $cmd in "".i.e.,

    exec('"'.$cmd.'"',$out ,$retval);
    

    This is the full code that works:

    
    

提交回复
热议问题