<?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>Tech Trivia &#187; MySQL</title>
	<atom:link href="http://www.alethe.com/brad/category/tech-notes/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alethe.com/brad</link>
	<description>For those who know just enough to be dangerous</description>
	<lastBuildDate>Sun, 28 Feb 2010 04:45:10 +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>Reset TYPO3 password</title>
		<link>http://www.alethe.com/brad/2009/04/reset-typo3-password/</link>
		<comments>http://www.alethe.com/brad/2009/04/reset-typo3-password/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:06:27 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Typo3 Snippets]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=40</guid>
		<description><![CDATA[If you forget your typo3 password, you can reset it using the mysql command line tool as follows: mysql> use typo3; mysql> update be_users set password='bacb98acf97e0b6112b1d1b650b84971' where username = 'admin'; This resets the admin user password to &#8220;joh316&#8243;.]]></description>
			<content:encoded><![CDATA[<p>If you forget your typo3 password, you can reset it using the mysql command line tool as follows:</p>
<p><code><br />
mysql> use typo3;<br />
mysql> update be_users set password='bacb98acf97e0b6112b1d1b650b84971' where username = 'admin';<br />
</code></p>
<p>This resets the admin user password to &#8220;joh316&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2009/04/reset-typo3-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install phpMyAdmin</title>
		<link>http://www.alethe.com/brad/2008/02/install-phpmyadmin/</link>
		<comments>http://www.alethe.com/brad/2008/02/install-phpmyadmin/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 03:01:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=38</guid>
		<description><![CDATA[phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure. Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference it. [...]]]></description>
			<content:encoded><![CDATA[<p>phpMyAdmin is web-based PHP application for managing MySQL databases.  It is fairly easy to install and configure.</p>
<p>Download the latest stable version from the <a href="http://www.phpmyadmin.net">phpMyAdmin web site</a>, and extract it to a location of your choice.  I prefer to keep the installation outside of the web root and use an apache alias to reference it.<br />
<span id="more-38"></span><br />
<code>[root@app3 ~]# cd /var/www<br />
[root@app3 ~]# wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
[root@app3 ~]# tar xzf phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
</code><br />
Now that&#8217;s a lengthy directory name!  Let&#8217;s create a link to that directory with a more friendly name.<br />
<code><br />
[root@app3 ~]# ln -s phpMyAdmin-2.11.5.2-all-languages-utf-8-only phpMyAdmin<br />
</code></p>
<p>SELinux may generate a number of errors regarding this new directory that will be referenced by the apache web server.  Let&#8217;s correct the security context of the entire phpMyAdmin directory structure.<br />
<code><br />
[root@app3 ~]# chcon -R -h -t httpd_sys_content_t \<br />
> phpMyAdmin-2.11.5.2-all-languages-utf-8-only<br />
</code></p>
<p>Configure the phpMyAdmin installation to use http authentication.  We&#8217;ll make sure it is secure by forcing SSL encryption using apache directives in a later step.<br />
<code><br />
[root@app3 ~]# cd phpMyAdmin<br />
[root@app3 ~]# cp config.sample.inc.php config.inc.php<br />
[root@app3 ~]# vi config.inc.php<br />
</code></p>
<p>Change the line:<br />
<code>$cfg['Servers'][$i]['auth_type'] = 'cookie';</code><br />
to:<br />
<code>$cfg['Servers'][$i]['auth_type'] = 'http';</code></p>
<p>Now we need to configure the apache web server.  To keep things modular, create a file <code>phpmyadmin.conf</code> in <code>/etc/httpd/conf.d</code>.  Any configuration directives in this file will automatically be loaded into the main apache configuration when the daemon is restarted.<br />
<code><br />
[root@app3 ~]# vi /etc/httpd/conf.d/phpmyadmin.conf<br />
</code></p>
<p>The <code>phpmyadmin.conf</code> file should contain the following directives.  Just modify the paths to suit your installation.<br />
<code></p>
<pre>
Alias /phpmyadmin /var/www/phpMyAdmin
&lt;Directory "/var/www/phpMyAdmin"&gt;
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    SSLRequireSSL
&lt;/Directory&gt;
</pre>
<p></code></p>
<p>Restart apache and see if your installation works.<br />
<code><br />
[root@app3 ~]# service httpd restart<br />
</code></p>
<p>If there are problems, check your logs.  It is possible that SELinux may be complaining about something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/02/install-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup and Restore Databases</title>
		<link>http://www.alethe.com/brad/2005/05/backup-and-restore-databases/</link>
		<comments>http://www.alethe.com/brad/2005/05/backup-and-restore-databases/#comments</comments>
		<pubDate>Wed, 04 May 2005 17:17:43 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=15</guid>
		<description><![CDATA[The following steps can be executed as a non privileged user on the server, however, the username and password you use with the commands needs to be a database user that has r/w privileges within MySQL (think &#8220;sa&#8221; account for Microsoft SQL Server). 1. Export the database to a SQL file. [user@host]$ mysqldump --opt --user=dbuser [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=alethe-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=0672326736&#038;fc1=999&#038;IS2=1&#038;lt1=_blank&#038;lc1=d8d7d3&#038;bc1=000000&#038;bg1=22201d&#038;f=ifr" style="width:120px;height:240px;float:right;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>The following steps can be executed as a non privileged user on the server, however, the username and password you use with the commands needs to be a database user that has r/w privileges within MySQL (think &#8220;sa&#8221; account for Microsoft SQL Server).</p>
<p>1. Export the database to a SQL file.<br />
<code><br />
[user@host]$ mysqldump --opt --user=dbuser &#92;<br />
    --password database > dumpfile.sql<br />
</code><br />
2. Edit the dump file and put these lines at the beginning:<br />
<code><br />
SET AUTOCOMMIT = 0;<br />
SET FOREIGN_KEY_CHECKS=0;<br />
</code><br />
3. Put these lines at the end:<br />
<code><br />
SET FOREIGN_KEY_CHECKS = 1;<br />
COMMIT;<br />
SET AUTOCOMMIT = 1;<br />
</code><br />
4. Import the database SQL file into MySQL.  This will overwrite the contents of the current database.<br />
<code><br />
[user@host]$ mysql --user=dbuser &#92;<br />
--password database < dumpfile.sql<br />
</code><br />
Click <a href="http://sourceforge.net/projects/automysqlbackup/">here</a> for a good shell script that automates the backup of MySQL databases.  Version 2.5 is available <a href="http://www.alethe.com/downloads/mysqlbackup.sh.gz">here</a> for download.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2005/05/backup-and-restore-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set the Root Password</title>
		<link>http://www.alethe.com/brad/2005/04/set-the-root-password/</link>
		<comments>http://www.alethe.com/brad/2005/04/set-the-root-password/#comments</comments>
		<pubDate>Fri, 29 Apr 2005 17:18:25 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=16</guid>
		<description><![CDATA[After installing MySQL, the first thing you&#8217;ll want to do is reset the root password for MySQL. You can achieve this using the following command: [root@myhost]# mysqladmin -u root password new-password Set MySQL to start automatically with the following command [root@myhost]# /sbin/chkconfig mysqld on Update: A much better way to secure your installation of MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>After installing MySQL, the first thing you&#8217;ll want to do is reset the root password for MySQL. You can achieve this using the following command:<br />
<code><br />
[root@myhost]# mysqladmin -u root password <em>new-password</em><br />
</code><br />
Set MySQL to start automatically with the following command<br />
<code><br />
[root@myhost]# /sbin/chkconfig mysqld on<br />
</code></p>
<p><strong>Update:</strong><br />
A much better way to secure your installation of MySQL is to run the <code>mysql_secure_installation</code> command.  This prompts you to set or change the root password, remove guest access and test databases, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2005/04/set-the-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
