<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: mysql import via command line using PHP in Archive</title>
    <link>https://business.forums.bt.com/t5/Archive/mysql-import-via-command-line-using-PHP/m-p/45752#M14619</link>
    <description>&lt;P&gt;The 'system' command is one of the servers higher level functions&amp;nbsp; known as a Shell script and is normally unavailable to&amp;nbsp; users on shared hosting for security reasons.&lt;EM&gt; Note: some web hosting providers would of suspended your account if they found you trying to use this.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A workaround is to read the file to be imported to the database in large blocks and use the &lt;STRONG&gt;SQL Bulk Insert&lt;/STRONG&gt; command syntax.&lt;/P&gt;</description>
    <pubDate>Sun, 23 Sep 2012 10:48:50 GMT</pubDate>
    <dc:creator>Sogo7</dc:creator>
    <dc:date>2012-09-23T10:48:50Z</dc:date>
    <item>
      <title>mysql import via command line using PHP</title>
      <link>https://business.forums.bt.com/t5/Archive/mysql-import-via-command-line-using-PHP/m-p/45502#M14618</link>
      <description>&lt;P&gt;I'm trying to import a Wordpress database via the command line, using PHP.&lt;BR /&gt;&lt;BR /&gt;Yes, I know I can use the cPanel to do it via the phpMyAdmin (which is what I just did).&lt;BR /&gt;&lt;BR /&gt;I would like to have a simple php file that I can import the database without having to log into cPanel, as I'm probably going to be doing this often for testing purposes on a production Wordpress blog for a customer.&lt;BR /&gt;&lt;BR /&gt;What I have in the php file:&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php system('mysql -h localhost -u MyUserName -p MyPassword -d MyDatabase &amp;lt; MyDumpFile;'); ?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The only output I get is the same as if I entered 'mysql -?` from the command line.&lt;BR /&gt;&lt;BR /&gt;I have verified that the username, password, database, and dump file names are all correct. When I changed it to a mysqldump command (with appropriate syntax changes), it worked fine.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I figure there is something I'm missing, but can't figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;________&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Orthohin &lt;IMG src="http://imagicon.info/cat/12-1/text-smiley.png" /&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Sep 2012 10:17:47 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/mysql-import-via-command-line-using-PHP/m-p/45502#M14618</guid>
      <dc:creator>orthohin</dc:creator>
      <dc:date>2012-09-15T10:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: mysql import via command line using PHP</title>
      <link>https://business.forums.bt.com/t5/Archive/mysql-import-via-command-line-using-PHP/m-p/45752#M14619</link>
      <description>&lt;P&gt;The 'system' command is one of the servers higher level functions&amp;nbsp; known as a Shell script and is normally unavailable to&amp;nbsp; users on shared hosting for security reasons.&lt;EM&gt; Note: some web hosting providers would of suspended your account if they found you trying to use this.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A workaround is to read the file to be imported to the database in large blocks and use the &lt;STRONG&gt;SQL Bulk Insert&lt;/STRONG&gt; command syntax.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Sep 2012 10:48:50 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/mysql-import-via-command-line-using-PHP/m-p/45752#M14619</guid>
      <dc:creator>Sogo7</dc:creator>
      <dc:date>2012-09-23T10:48:50Z</dc:date>
    </item>
  </channel>
</rss>

