<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Open Tech Notes</title>
	<link>http://zft.backupdiy.com</link>
	<description>All about open sources, like linux, apache, php, Zend Framework, MySQL, CentOS, Apachefriends...</description>
	<pubDate>Wed, 07 May 2008 05:32:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>MySQL Could not start on Apache Friends</title>
		<link>http://zft.backupdiy.com/2007/09/02/mysql-could-not-start-on-apache-friends/</link>
		<comments>http://zft.backupdiy.com/2007/09/02/mysql-could-not-start-on-apache-friends/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 07:36:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Linux Admin</dc:subject>
	<dc:subject>MySQL</dc:subject>
	<dc:subject>command</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/09/02/mysql-could-not-start-on-apache-friends/</guid>
		<description><![CDATA[Today, I setup security for&#160; Apache Friends package on one of my CentOS (5.0 final) servers. After I followed the command:
./lampp security
setup password for the lampp demo web page
turn off access Mysql via the network
Then, the Mysql server could not start. Even I use command:
./lampp startmysql
it said
Mysql Starting and exit to command line.
(note: the apache [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I setup security for&nbsp; Apache Friends package on one of my CentOS (5.0 final) servers. After I followed the command:</p>
<p><strong>./lampp security</strong></p>
<p>setup password for the lampp demo web page<br />
turn off access Mysql via the network</p>
<p>Then, the Mysql server could not start. Even I use command:</p>
<p>.<strong>/lampp startmysql</strong></p>
<p>it said</p>
<p>Mysql Starting and exit to command line.</p>
<p>(note: the apache friends package version is 1.63a)</p>
<p>So, I went to apachefriends.org to find the answer and unfortunately I did not find anything that can help. I decided to upgrade it to the latest version(1.63b) because this server is currently not in service. I don&#8217;t worry about the data lose. Upgrading was smooth, but it did not work too.</p>
<p>Anyway, the last result, I removed the whole folder /lampp from /opt and re-installed&nbsp; apache friends version 1.63b. It worked fine.</p>
<p>One thing I need to remember: <strong>Don&#8217;t forget stop lampp before remove the folder /lampp</strong>, otherwise, it will waste a lot of time to kill some process manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/09/02/mysql-could-not-start-on-apache-friends/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Improving MySQL database backup script</title>
		<link>http://zft.backupdiy.com/2007/07/03/improving-mysql-database-backup-script/</link>
		<comments>http://zft.backupdiy.com/2007/07/03/improving-mysql-database-backup-script/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 17:12:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>MySQL</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/07/03/improving-mysql-database-backup-script/</guid>
		<description><![CDATA[The original script is here
Reason: As usual, I checked the database backup file and found the size was really small. It meant the backup script had some problems. After then, I was told that the database&#8217;s root password had been changed. Oh, that was the culprit!
Now that I know what the problem is, how can [...]]]></description>
			<content:encoded><![CDATA[<p>The original script is <a href="http://zft.backupdiy.com/2007/04/28/mysql-database-backup-script/">here</a></p>
<p><strong>Reason:</strong> As usual, I checked the database backup file and found the size was really small. It meant the backup script had some problems. After then, I was told that the database&#8217;s root password had been changed. Oh, that was the culprit!</p>
<p>Now that I know what the problem is, how can I improve it?</p>
<p>The first thing comes to my mind is: I must add a flow controller statement which will tell me (by email)&nbsp; if the backup process is successful.&nbsp; But what if I read the email too late and the backup time is missed? Fortunately, the password is stored in a configuration file. Whenever the DB admin changes the password, she has to change the configuration file. So the better solution is: read the password from the configuration file instead of hard code in the script file.
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/07/03/improving-mysql-database-backup-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MySQL database backup script</title>
		<link>http://zft.backupdiy.com/2007/04/28/mysql-database-backup-script/</link>
		<comments>http://zft.backupdiy.com/2007/04/28/mysql-database-backup-script/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 20:10:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>Linux Admin</dc:subject>
	<dc:subject>MySQL</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/04/28/mysql-database-backup-script/</guid>
		<description><![CDATA[#!/bin/bash
#=============================================================================
# MySQL Backup Script (file name: dbbackup)
# Ver. 0.2
# Author Jason Qi (email@yahoo.com)
# 
# This script works under CentOS with Appache Friends.
# Before you start, please create folder 
#&#160;&#160; /opt/lampp\dbbackup 
#&#160;&#160;&#160;&#160; and 
#&#160;&#160; /opt/lampp/htdocs/cams2/dbbackup
# Put this file into /opt/lampp/bin and chmod +x dbbackup.
# Create dbbackupmsg file and put it into /opt/lampp/bin. The content inside 
# [...]]]></description>
			<content:encoded><![CDATA[<p>#!/bin/bash</p>
<p>#=============================================================================<br />
# MySQL Backup Script (file name: dbbackup)<br />
# Ver. 0.2<br />
# Author Jason Qi (email@yahoo.com)<br />
# <br />
# This script works under CentOS with Appache Friends.<br />
# Before you start, please create folder <br />
#&nbsp;&nbsp; /opt/lampp\dbbackup <br />
#&nbsp;&nbsp;&nbsp;&nbsp; and <br />
#&nbsp;&nbsp; /opt/lampp/htdocs/cams2/dbbackup<br />
# Put this file into /opt/lampp/bin and chmod +x dbbackup.<br />
# Create dbbackupmsg file and put it into /opt/lampp/bin. The content inside <br />
# this file is &quot;Backup is done&quot;<br />
#&nbsp;&nbsp; <br />
# The last step is create a crontab<br />
#&nbsp;&nbsp; crontab -e<br />
#&nbsp;&nbsp; 30 3 * * * /opt/lampp/bin/dbbackup <br />
#=============================================================================<br />
#<br />
# Please change the params to fit the system needs.<br />
#<br />
#=============================================================================<br />
<!--adsense#middle--><br />
USER=&quot;root&quot;;<br />
PASSWORD=&quot;password&quot;;<br />
DATABASE=&quot;dbname&quot;;<br />
EMAIL=&quot;email@yahoo.com&quot;;<br />
MYSQLDUMP=&quot;/opt/lampp/bin/mysqldump&quot;;</p>
<p>MPATH=&quot;/opt/lampp/dbbackup&quot;;<br />
CPATH=&quot;/opt/lampp/htdocs/cams2/dbbackup&quot;;</p>
<p>MDATE=`/bin/date &quot;+%Y-%m-%d-%Hh%Mm&quot;`;<br />
CDATE=`/bin/date &quot;+%A&quot;`;</p>
<p>MDUMP=&quot;$DATABASE-$MDATE&quot;;<br />
CDUMP=&quot;$DATABASE-$CDATE&quot;;</p>
<p>EXT1=&quot;.sql&quot;;<br />
EXT2=&quot;.tar&quot;;<br />
EXT3=&quot;.gz&quot;;</p>
<p>#=============================================================================<br />
# Change log<br />
#=============================================================================<br />
# VER 0.2 - 2007-04-28 Revise thid document by changing all &quot;\&quot; to &quot;/&quot; in pathname<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add crontab command to this document<br />
# VER 0.1 - 2007-04-15<br />
#&nbsp;&nbsp; Initial Release<br />
#=============================================================================</p>
<p>$MYSQLDUMP &#8211;add-drop-table &#8211;user=$USER &#8211;password=$PASSWORD $DATABASE &gt;&gt; &quot;$DUMP$EXT1&quot;;</p>
<p>/bin/tar -cf $MPATH/$DATABASE-$MDATE$EXT2 $DUMP$EXT1;<br />
/bin/gzip -f $MPATH/$DATABASE-$MDATE$EXT2;</p>
<p>/bin/tar -cf $CPATH/$DATABASE-$CDATE$EXT2 $DUMP$EXT1;<br />
/bin/gzip -f $CPATH/$DATABASE-$CDATE$EXT2;</p>
<p>/bin/rm -f $DUMP$EXT1;</p>
<p>cat &quot;dbbackupmsg&quot; | mail -s $MDATE-&quot;Backup is done&quot; $EMAIL;
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/04/28/mysql-database-backup-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Rename&#8221; database name in MySQL</title>
		<link>http://zft.backupdiy.com/2007/04/28/rename-database-name-in-mysql/</link>
		<comments>http://zft.backupdiy.com/2007/04/28/rename-database-name-in-mysql/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 19:01:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<dc:subject>MySQL</dc:subject>
		<guid isPermaLink="false">http://zft.backupdiy.com/2007/04/28/rename-database-name-in-mysql/</guid>
		<description><![CDATA[Currently, there is no method to rename database name in MySQL, but you could easily use&#160; mysqldump command backup&#160; your database and then read it back in to a new database. 
Step 1 Dump the database structure and content:
&#160; mysqldump -u username -p  dbname &#62;&#62; dump.sql
Step 2 Create a new empty database. 
&#160;
&#160; mysql [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, there is no method to rename database name in MySQL, but you could easily use&nbsp; mysqldump command backup&nbsp; your database and then read it back in to a new database. </p>
<p><strong>Step 1 Dump the database structure and content:</strong></p>
<p>&nbsp; mysqldump -u username -p  dbname &gt;&gt; dump.sql</p>
<p><strong>Step 2 Create a new empty database. <br />
&nbsp;<br />
&nbsp; </strong>mysql -u username -p dbname<br />
&nbsp; mysql&gt; create database newdbname;<strong><br />
</strong><br />
<strong>Step 3 Reload the database into a new database with a different name:</strong></p>
<p>&nbsp; mysql  -u username -p newdbname &lt; dump.sql
</p>
]]></content:encoded>
			<wfw:commentRss>http://zft.backupdiy.com/2007/04/28/rename-database-name-in-mysql/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
