Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to import .sql file in mysql database using php
    text
    copied!<p>how to import .sql file in mysql database using php </p> <p>how can i do this please help me to fix this issue thanks</p> <p>this code showing this error..</p> <pre><code>There was an error during import. Please make sure the import file is saved in the same folder as this script and check your values: MySQL Database Name: test MySQL User Name: root MySQL Password: NOTSHOWN MySQL Host Name: localhost MySQL Import Filename: dbbackupmember.sql </code></pre> <p>i am using this code</p> <pre><code>&lt;?php //ENTER THE RELEVANT INFO BELOW $mysqlDatabaseName ='test'; $mysqlUserName ='root'; $mysqlPassword =''; $mysqlHostName ='localhost'; $mysqlImportFilename ='dbbackupmember.sql'; //DONT EDIT BELOW THIS LINE //Export the database and output the status to the page $command='mysql -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' &lt; ' .$mysqlImportFilename; exec($command,$output=array(),$worked); switch($worked){ case 0: echo 'Import file &lt;b&gt;' .$mysqlImportFilename .'&lt;/b&gt; successfully imported to database &lt;b&gt;' .$mysqlDatabaseName .'&lt;/b&gt;'; break; case 1: echo 'There was an error during import. Please make sure the import file is saved in the same folder as this script and check your values:&lt;br/&gt;&lt;br/&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;MySQL Database Name:&lt;/td&gt;&lt;td&gt;&lt;b&gt;' .$mysqlDatabaseName .'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MySQL User Name:&lt;/td&gt;&lt;td&gt;&lt;b&gt;' .$mysqlUserName .'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MySQL Password:&lt;/td&gt;&lt;td&gt;&lt;b&gt;NOTSHOWN&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MySQL Host Name:&lt;/td&gt;&lt;td&gt;&lt;b&gt;' .$mysqlHostName .'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MySQL Import Filename:&lt;/td&gt;&lt;td&gt;&lt;b&gt;' .$mysqlImportFilename .'&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'; break; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload