<?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>Techonia.com &#187; MySQL</title>
	<atom:link href="http://www.techonia.com/category/database/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techonia.com</link>
	<description>News, Tutorials, and How-tos about Technology</description>
	<lastBuildDate>Fri, 30 Jul 2010 11:19:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to backup a table in MySQL database and copy to another database</title>
		<link>http://www.techonia.com/backup-table-mysql-database</link>
		<comments>http://www.techonia.com/backup-table-mysql-database#comments</comments>
		<pubDate>Wed, 09 Dec 2009 22:44:05 +0000</pubDate>
		<dc:creator>Fuad NAHDI</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.techonia.com/?p=738</guid>
		<description><![CDATA[Sometime you want to backup a table and all its contents in MySQL Database and then you might want to restore or copy the table to different MySQL database]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><script type="text/javascript">
			<!-- 
			tweetmeme_url = "http://www.techonia.com/backup-table-mysql-database";
			tweetmeme_source = "techonia";
			//-->
		</script>
		<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><div class="KonaBody"><p>Sometime you want to backup a table and all its contents in MySQL Database and then you might want to restore or copy the table to different MySQL database.<br />
To do this you need to dump the table first and then restore to the target database.<span id="more-738"></span><br />
Assume you have two database, db01 and db02. Inside the db01, there are table01 and table02 whereas inside the db02 there are table03 and table04.<br />
In this example you want to copy table01 in db01 to the db02. Here are the steps:</p>
<p><strong>1. Dump table01 using mysqldump command and save as table01.sql</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqldump <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> db01 table01 <span style="color: #000000; font-weight: bold;">&gt;</span> table01.sql
Enter password:</pre></div></div>

<p>You will get a file table01.sql generated by the command above.</p>
<p><strong>2. Restore or copy the table01.sql to db02 database using command below:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> db02 <span style="color: #000000; font-weight: bold;">&lt;</span> table01.sql
Enter password:</pre></div></div>

<p>Verify that the table01 has been copied to the db02.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-p</span>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">207886</span>
Server version: 5.0.67 Source distribution
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the buffer.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span> use db02;
Reading table information <span style="color: #000000; font-weight: bold;">for</span> completion of table and column names
You can turn off this feature to get a quicker startup with <span style="color: #660033;">-A</span>
&nbsp;
Database changed
mysql<span style="color: #000000; font-weight: bold;">&gt;</span> show tables;
+-----------------------+
<span style="color: #000000; font-weight: bold;">|</span> Tables_in_db02        <span style="color: #000000; font-weight: bold;">|</span>
+-----------------------+
<span style="color: #000000; font-weight: bold;">|</span> table01               <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> table03               <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> table04               <span style="color: #000000; font-weight: bold;">|</span>
+-----------------------+
<span style="color: #000000;">3</span> rows <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

</div><h4>Incoming search terms for this post:</h4><ul><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql backup table to another table">mysql backup table to another table</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql copy backup in">mysql copy backup in</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="copy contents of mysql database">copy contents of mysql database</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="\SQL Backup Table\">\SQL Backup Table\</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="php mysql copy table to another table">php mysql copy table to another table</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="php copy to c:">php copy to c:</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql table backup">mysql table backup</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql restore table backup a table">mysql restore table backup a table</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql duplicate contents of table from two different db">mysql duplicate contents of table from two different db</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="mysql copy table to another server C">mysql copy table to another server C</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="php mysql copy_to">php mysql copy_to</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="restore a table backup mysql">restore a table backup mysql</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="slackware mysql restore database">slackware mysql restore database</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="transferring mysql database from freeBSD to centos 5">transferring mysql database from freeBSD to centos 5</a></li><li><a href="http://www.techonia.com/backup-table-mysql-database" title="transfer contents of a table in mysql">transfer contents of a table in mysql</a></li></ul><!-- SEO SearchTerms Tagging 2 plugin took 6.988 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.techonia.com/backup-table-mysql-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change MySQL root password</title>
		<link>http://www.techonia.com/change-reset-mysql-root-password</link>
		<comments>http://www.techonia.com/change-reset-mysql-root-password#comments</comments>
		<pubDate>Wed, 09 Dec 2009 21:25:47 +0000</pubDate>
		<dc:creator>Fuad NAHDI</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.techonia.com/?p=734</guid>
		<description><![CDATA[In some cases you might want to change or reset MySQL root password. To do this there are two ways, using mysqladmin command or using UPDATE sql command]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><script type="text/javascript">
			<!-- 
			tweetmeme_url = "http://www.techonia.com/change-reset-mysql-root-password";
			tweetmeme_source = "techonia";
			//-->
		</script>
		<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><div class="KonaBody"><p>In some cases you might want to change or reset MySQL root password.<br />
To do this there are two ways, using mysqladmin command or using UPDATE sql command.</p>
<p><strong>1. Using mysqladmin command.</strong><br />
Login to the server where the MySQL database is installed. From the current shell run mysqladmin command below:<br />
<span id="more-734"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqladmin <span style="color: #660033;">-u</span> root <span style="color: #660033;">-pcurrentpassword</span> password <span style="color: #ff0000;">'newpassword'</span></pre></div></div>

<p>Note that between the option &#8216;-p&#8217; and the &#8216;currentpassword&#8217; must be without any space.<br />
For the &#8216;-u&#8217; option and &#8216;root&#8217; it can be with or without space. And also the &#8216;newpassword&#8217;, it can be with or withour single quote.<br />
So the following two commands will just work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqladmin <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-pcurrentpassword</span> password <span style="color: #ff0000;">'newpassword'</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqladmin <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-pcurrentpassword</span> password newpassword</pre></div></div>

<p>Verify that you can login to the MySQL using the newpassword.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-p</span>
Enter password: <span style="color: #000000; font-weight: bold;">&lt;</span>enter the newpassword here<span style="color: #000000; font-weight: bold;">&gt;</span>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">207702</span>
Server version: 5.0.67 Source distribution
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the buffer.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p><strong>2. Using UPDATE SQL command</strong><br />
Using this method you have to login first to MySQL using existing root password. On the mysql command prompt, run the following command below to change the MySQL root password.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql<span style="color: #000000; font-weight: bold;">&gt;</span> UPDATE user SET <span style="color: #007800;">password</span>=PASSWORD<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> WHERE <span style="color: #007800;">user</span>=<span style="color: #ff0000;">'root'</span>;
Query OK, <span style="color: #000000;">1</span> row affected <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Rows matched: <span style="color: #000000;">1</span>  Changed: <span style="color: #000000;">1</span>  Warnings: <span style="color: #000000;">0</span></pre></div></div>

<p>Again verify that you can login using the newpassword.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-pnewpassword</span>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">207736</span>
Server version: 5.0.67 Source distribution
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the buffer.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

</div><h4>Incoming search terms for this post:</h4><ul><li><a href="http://www.techonia.com/change-reset-mysql-root-password" title="how to change password in c shell">how to change password in c shell</a></li></ul><!-- SEO SearchTerms Tagging 2 plugin took 1.856 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.techonia.com/change-reset-mysql-root-password/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Install MySQL from source distribution</title>
		<link>http://www.techonia.com/quick-install-mysql-source</link>
		<comments>http://www.techonia.com/quick-install-mysql-source#comments</comments>
		<pubDate>Mon, 03 Aug 2009 04:39:39 +0000</pubDate>
		<dc:creator>Fuad NAHDI</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.katalis.web.id/?p=248</guid>
		<description><![CDATA[This tutorial will show you how to install MySQL server from source distribution. I use Linux for this tutorial but it should be application in other UNIXs operating system.
]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button-left"><script type="text/javascript">
			<!-- 
			tweetmeme_url = "http://www.techonia.com/quick-install-mysql-source";
			tweetmeme_source = "techonia";
			//-->
		</script>
		<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><div class="KonaBody"><p>This tutorial will show you on how to install MySQL server from source distribution. I use Slackware for this tutorial but it should be application in other Linux distros (Centos, Ubuntu, Redhat, Fedora, Debian, etc) and BSDs varian (FreeBSD, PC-BSD, NetBSD, and OpenBSD).</p>
<p>Basically the explanation on how to install MySQL is already explained the INSTALL-* files included in the source file. This tutorial is only a quick step and straightforward way because if you are a newbie you will take some times to read the INSTALL-* files.<span id="more-248"></span></p>
<p>First download the MySQL source <a href="http://dev.mysql.com/downloads/">here</a>. At the time this tutorial written, the latest stable version of MySQL is 5.1.37.</p>
<p>Untar, configure and then compile the source. We will install it in /usr/local/mysql5 folder as the target.</p>
<p>Here are the complete steps:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zxf mysql-5.1.37.tar.gz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> mysql-5.1.37
$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql5 <span style="color: #660033;">--mandir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># groupadd mysql</span>
<span style="color: #666666; font-style: italic;"># useradd -g mysql -s /bin/false -c 'MySQL Database' mysql</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cd /usr/local/mysql5</span>
<span style="color: #666666; font-style: italic;"># chown -R mysql .</span>
<span style="color: #666666; font-style: italic;"># chgrp -R mysql .</span>
<span style="color: #666666; font-style: italic;"># ./bin/mysql_install_db --user=mysql</span>
<span style="color: #666666; font-style: italic;"># chown -R root .</span>
<span style="color: #666666; font-style: italic;"># chown -R mysql var</span>
<span style="color: #666666; font-style: italic;"># ./bin/mysqld_safe --user=mysql &amp;</span></pre></div></div>

<p>Check the MySQL service is now running and LISTEN on 3306 port.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># netstat -atp|grep mysql</span>
tcp        <span style="color: #000000;">0</span>      <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">3306</span>    <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000; font-weight: bold;">*</span>    LISTEN    <span style="color: #000000;">23767</span><span style="color: #000000; font-weight: bold;">/</span>mysqld</pre></div></div>

<p>Do not forget to set the root password for MySQL (not system root password) by firing the command below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /usr/local/mysql5/bin/mysqladmin -u root password yourpassword</span></pre></div></div>

<p>Now you can try to log in to the MySQL server by issuing the command below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql5<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">5</span>
Server version: 5.1.37 Source distribution
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the current input statement.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span> show databases;
+--------------------+
<span style="color: #000000; font-weight: bold;">|</span> Database           <span style="color: #000000; font-weight: bold;">|</span>
+--------------------+
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> mysql              <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #7a0874; font-weight: bold;">test</span>               <span style="color: #000000; font-weight: bold;">|</span>
+--------------------+
<span style="color: #000000;">3</span> rows <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

</div><h4>Incoming search terms for this post:</h4><ul><li><a href="http://www.techonia.com/quick-install-mysql-source" title="how to install mysql Pcbsd">how to install mysql Pcbsd</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="mysql source distribution">mysql source distribution</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="slackware mysql from sources">slackware mysql from sources</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="mysql">mysql</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="compile mysql on freebsd from source">compile mysql on freebsd from source</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="fedora install mysql 5 1 from source">fedora install mysql 5 1 from source</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="opensolaris install mysql source">opensolaris install mysql source</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="how instal mysql to pcbsd?">how instal mysql to pcbsd?</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="how to install mysql on pcbsd">how to install mysql on pcbsd</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="install mysql from source">install mysql from source</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="quick install mysql">quick install mysql</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="install mysql on freebsd via source">install mysql on freebsd via source</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="mysql source distributions">mysql source distributions</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="mysql download source distribution">mysql download source distribution</a></li><li><a href="http://www.techonia.com/quick-install-mysql-source" title="mysqL pcbsd">mysqL pcbsd</a></li></ul><!-- SEO SearchTerms Tagging 2 plugin took 10.14 ms -->]]></content:encoded>
			<wfw:commentRss>http://www.techonia.com/quick-install-mysql-source/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
