<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KADIMI [Web Dev, SEO, Linux...] &#187; MySQL</title>
	<atom:link href="http://www.kadimi.com/en/category/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kadimi.com/en</link>
	<description>Blog &#38; Free Tech Support</description>
	<lastBuildDate>Mon, 28 Jun 2010 22:54:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL statement terminators</title>
		<link>http://www.kadimi.com/en/mysql-query-terminators-440</link>
		<comments>http://www.kadimi.com/en/mysql-query-terminators-440#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:15:32 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=440</guid>
		<description><![CDATA[There is the semicolon &#8220;;&#8221; that every one knows, and &#8220;\g&#8221; which is just the same: mysql &#62; SELECT * FROM wp_links; mysql &#62; SELECT * FROM wp_links\g Those are exactly the same, and will produce the same result, here is an example: mysql&#62; select * from wp_links \g +---------+-----------------------+--------------+------------+-------------+---------------+------------------+--------------+------------+-------------+---------------------+----------+------------+-----------------------+ &#124; link_id &#124; link_url &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>There is the semicolon &#8220;;&#8221; that every one knows, and &#8220;\g&#8221; which is just the same:</p>
<blockquote><p><code>mysql &gt; SELECT * FROM wp_links;<br />
mysql &gt; SELECT * FROM wp_links\g</code></p></blockquote>
<p>Those are exactly the same, and will produce the same result, here is an example:</p>
<blockquote><p><code>mysql&gt; select * from wp_links \g<br />
<span style="color: #999999;">+---------+-----------------------+--------------+------------+-------------+---------------+------------------+--------------+------------+-------------+---------------------+----------+------------+-----------------------+<br />
| link_id | link_url              | link_name    | link_image | link_target | link_category | link_description | link_visible | link_owner | link_rating | link_updated        | link_rel | link_notes | link_rss              |<br />
+---------+-----------------------+--------------+------------+-------------+---------------+------------------+--------------+------------+-------------+---------------------+----------+------------+-----------------------+<br />
|       1 | http://www.ar-wp.com/ | WP arabic |            |             |             0 |                  | Y            |          1 |           0 | 0000-00-00 00:00:00 |          |            | http://www.ar-wp.com/ |<br />
+---------+-----------------------+--------------+------------+-------------+---------------+------------------+--------------+------------+-------------+---------------------+----------+------------+-----------------------+<br />
1 row in set (0.01 sec)</span><br />
</code></p></blockquote>
<p>\G is another valid statement terminator, it tells MySQL to produce vertical output, this comes in handy when the result has too much columns, here is the same statement again but with the \G terminator:</p>
<blockquote><p><code>mysql&gt; select * from wp_links\G<br />
<span style="color: #999999;">*************************** 1. row ***************************<br />
link_id: 1<br />
link_url: http://www.ar-wp.com/<br />
link_name: WP arabic<br />
link_image:<br />
link_target:<br />
link_category: 0<br />
link_description:<br />
link_visible: Y<br />
link_owner: 1<br />
link_rating: 0<br />
link_updated: 0000-00-00 00:00:00<br />
link_rel:<br />
link_notes:<br />
link_rss: http://www.ar-wp.com/<br />
1 row in set (0.00 sec)</span></code></p></blockquote>
<p>As you can see this is a more user friendly fashion for displaying data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/mysql-query-terminators-440/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL script files tutorial for beginners</title>
		<link>http://www.kadimi.com/en/script-files-149</link>
		<comments>http://www.kadimi.com/en/script-files-149#comments</comments>
		<pubDate>Mon, 22 Jun 2009 19:38:33 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=149</guid>
		<description><![CDATA[What is a MySQL script file?.. Why use it? A MySQL script file (aka MySQL batch file) is a regular text file containing MySQL statements separeted by terminantors, statements in a MySQL script file can be executed from the MySQL client, this is very useful, many PHP script available online come with MySQL script files [...]]]></description>
			<content:encoded><![CDATA[<h2>What is a MySQL script file?.. Why use it?</h2>
<p>A <strong>MySQL script file</strong> (aka MySQL batch file) is a regular text file containing MySQL statements separeted by terminantors, statements in a MySQL script file can be executed from the MySQL client, this is very useful, many PHP script available online come with MySQL script files that need to be executed as part of the PHP script installation process, <span id="more-149"></span>when you have PHPMyAdmin (or some other tool) available, you can copy the contents of the MySQL script file then paste those statements into PHPMyAdmin and run the SQL queries, this works fine on local servers and/or for small MySQL script files, but if you have 20000 MySQL queries (maybe you are trying to restore your forum database), using copy/paste and PHPMyAdmin is a very <span style="color: #ff0000;">bad idea</span>.</p>
<h2>Execute MySQL script files from MySQL client</h2>
<p>You can run MySQL script files from the MySQL client like this</p>
<blockquote><p><code>mysql&gt; SOURCE <em>path_to_script_file</em>;</code></p></blockquote>
<p>or</p>
<blockquote><p><code>mysql&gt; \. <em>path_to_script_file</em>;</code></p></blockquote>
<p>path_to_script_file is an absolute or relative path (relative to the directory from which you invoked the MySQL client), examples:</p>
<blockquote><p><code>mysql&gt; SOURCE queries.sql;<br />
mysql&gt; SOURCE ./../sql/queries.sql;<br />
mysql&gt; SOURCE C:\wamp\sql\queries.sql;</code></p>
<p>&#8211; exactly the same as :</p>
<p><code>mysql&gt; \. queries.sql;<br />
mysql&gt; \. ./../sql/queries.sql;<br />
mysql&gt; \. C:\wamp\sql\queries.sql;</code></p></blockquote>
<h2>Execute MySQL script files from the shell</h2>
<p>You can execute a MySQL script file directly from the shell with the <code>mysql</code> command like this:</p>
<blockquote><p><code><br />
shell&gt; mysql <em>database_name</em> &lt; <em>path_to_script_file</em><br />
or<br />
shell&gt; mysql -f <em>database_name</em> &lt; <em>path_to_script_file</em><br />
or<br />
shell&gt; mysql --force <em>database_name</em> &lt; <em>path_to_script_file</em><br />
</code></p></blockquote>
<p>The -f (or &#8211;force) option tells mysql to continue the execution of upcoming queries even if it encounters errors, some examples:</p>
<blockquote><p><code><br />
shell&gt; mysql <em>database_name</em> &lt; script.sql<br />
shell&gt; mysql -f <em>database_name</em> &lt; ../sql/script_with_errors.sql<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/script-files-149/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
