<?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>Ivan Villareal &#187; Mysql5 and PHP5 on centos4 &#8211; Ivan Villareal</title>
	<atom:link href="http://ivanvillareal.com/tag/installation/feed/" rel="self" type="application/rss+xml" />
	<link>http://ivanvillareal.com</link>
	<description>IT stuff and more...</description>
	<lastBuildDate>Tue, 01 Nov 2011 23:00:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mysql5 and PHP5 on centos4</title>
		<link>http://ivanvillareal.com/linux/mysql5-and-php5-on-centos4/</link>
		<comments>http://ivanvillareal.com/linux/mysql5-and-php5-on-centos4/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 19:00:06 +0000</pubDate>
		<dc:creator>Ivan Villareal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ivanvillareal.com/?p=76</guid>
		<description><![CDATA[I have the need to install php5 and mysql 5 on a centos 4 server, so I found that the Centos Plus repository had this, and this is what I [...]]]></description>
			<content:encoded><![CDATA[<p>I have the need to install php5 and mysql 5 on a centos 4 server, so I found that the Centos Plus repository had this, and this is what I did to get these two working.</p>
<p>First check what is the version of the distro:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/*</span>release<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>Then make an update:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum update</pre></div></div>

<p>After 496 package updates I&#8217;ve installed php5</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">--enablerepo</span>=centosplus <span style="color: #c20cb9; font-weight: bold;">install</span> php</pre></div></div>

<p>This were the installed packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php-5.1.6-<span style="color: #000000;">3</span>.el4s1.10
php-cli-5.1.6-<span style="color: #000000;">3</span>.el4s1.10
php-common-5.1.6-<span style="color: #000000;">3</span>.el4s1.10</pre></div></div>

<p>So I&#8217;ve created a info.php file, and restarted the apache server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&lt; ?php phpinfo(); ?&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>info.php <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> service httpd restart</pre></div></div>

<p>It was working correctly, so the next thing was to have mysql 5 in it, so I did:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">--enablerepo</span>=centosplus <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server</pre></div></div>

<p>I got some problems here, first I got this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Transaction Check Error: <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>my.cnf from <span style="color: #c20cb9; font-weight: bold;">install</span> of mysql-libs-5.0.68-<span style="color: #000000;">1</span>.el4_6 conflicts with <span style="color: #c20cb9; font-weight: bold;">file</span> from package mysql-4.1.22-<span style="color: #000000;">2</span>.el4
<span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>charsets<span style="color: #000000; font-weight: bold;">/</span>Index.xml from <span style="color: #c20cb9; font-weight: bold;">install</span> of mysql-libs-5.0.68-<span style="color: #000000;">1</span>.el4_6 conflicts with <span style="color: #c20cb9; font-weight: bold;">file</span> from package mysql-4.1.22-<span style="color: #000000;">2</span>.el4
<span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>charsets<span style="color: #000000; font-weight: bold;">/</span>README from <span style="color: #c20cb9; font-weight: bold;">install</span> of mysql-libs-5.0.68-<span style="color: #000000;">1</span>.el4_6 conflicts with <span style="color: #c20cb9; font-weight: bold;">file</span> from package mysql-4.1.22-<span style="color: #000000;">2</span>.el4
<span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>charsets<span style="color: #000000; font-weight: bold;">/</span>armscii8.xml from <span style="color: #c20cb9; font-weight: bold;">install</span> of mysql-libs-5.0.68-<span style="color: #000000;">1</span>.el4_6 conflicts with <span style="color: #c20cb9; font-weight: bold;">file</span> from package mysql-4.1.22-<span style="color: #000000;">2</span>.el4
<span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>charsets<span style="color: #000000; font-weight: bold;">/</span>ascii.xml from <span style="color: #c20cb9; font-weight: bold;">install</span> of mysql-libs-5.0.68-<span style="color: #000000;">1</span>.el4_6 conflicts with <span style="color: #c20cb9; font-weight: bold;">file</span> from package mysql-4.1.22-<span style="color: #000000;">2</span>.el4</pre></div></div>

<p>So what I found was that yum was trying to install mysql.i386 but the architechture is x86_64, to fix this I had to specify the arch</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">--enablerepo</span>=centosplus <span style="color: #c20cb9; font-weight: bold;">install</span> mysql.x86_64 mysql-server</pre></div></div>

<p>After this I was able to install it, but when I tried to start the server I received some errors about error messages not right, I&#8217;ve checked the installed packages and it was installed mysqlclient10, so I removed the error messages problem disappeared, however I still couldn&#8217;t startup the server, checking at the logs I found this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
091012 <span style="color: #000000;">11</span>:01:<span style="color: #000000;">18</span>  InnoDB: Started; log sequence number <span style="color: #000000;">0</span> <span style="color: #000000;">0</span>                       091012 <span style="color: #000000;">11</span>:01:<span style="color: #000000;">18</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ERROR<span style="color: #7a0874; font-weight: bold;">&#93;</span> Fatal error: Can<span style="color: #ff0000;">'t open and lock privilege tables: Table '</span>mysql.host<span style="color: #ff0000;">' doesn'</span>t exist                                                     091012 <span style="color: #000000;">11</span>:01:<span style="color: #000000;">18</span>  mysqld ended</pre></div></div>

<p>To fix this I cleared the data dir, that had som files, this was in &#8216;/var/lib/mysql&#8217; and after that I ran mysql_install_db:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /var/lib/mysql </span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rm -rf *</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mysql_install_db --user=mysql -ldata=/var/lib/mysql</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># service mysqld start</span></pre></div></div>

<p>After the server was up, I changed the root password and added a new user:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mysqladmin -u root password NEWPASSWORD</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>prestant mysql<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mysql -pNEWPASSWORD</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">Welcome <span style="color: #990099; font-weight: bold;">to</span> the MySQL monitor.  Commands <span style="color: #009900;">end</span> <span style="color: #990099; font-weight: bold;">with</span> <span style="color: #000033;">;</span> <span style="color: #CC0099; font-weight: bold;">or</span> \g.
Your MySQL <span style="color: #FF9900; font-weight: bold;">connection</span> id <span style="color: #CC0099; font-weight: bold;">is</span> <span style="color: #008080;">5</span>
Server <span style="color: #000099;">version</span>: 5.0.82sp1 Source distribution
&nbsp;
<span style="color: #990099; font-weight: bold;">Type</span> <span style="color: #008000;">'help;'</span> <span style="color: #CC0099; font-weight: bold;">or</span> <span style="color: #008000;">'<span style="color: #004000; font-weight: bold;">\h</span>'</span> for <span style="color: #990099; font-weight: bold;">help</span>. <span style="color: #990099; font-weight: bold;">Type</span> <span style="color: #008000;">'<span style="color: #004000; font-weight: bold;">\c</span>'</span> <span style="color: #990099; font-weight: bold;">to</span> clear the current input statement.
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #000099;">USER</span> <span style="color: #008000;">'ivan'</span>@<span style="color: #008000;">'<span style="color: #008080; font-weight: bold;">%</span>'</span> IDENTIFIED BY <span style="color: #008000;">'passhere'</span><span style="color: #000033;">;</span>
Query OK<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> rows affected <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #CC0099;">*</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'ivan'</span>@<span style="color: #008000;">'<span style="color: #008080; font-weight: bold;">%</span>'</span> IDENTIFIED BY <span style="color: #008000;">'passhere'</span> <span style="color: #990099; font-weight: bold;">WITH</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">OPTION</span> MAX_QUERIES_PER_HOUR <span style="color: #008080;">0</span> MAX_CONNECTIONS_PER_HOUR <span style="color: #008080;">0</span> MAX_UPDATES_PER_HOUR <span style="color: #008080;">0</span> MAX_USER_CONNECTIONS <span style="color: #008080;">0</span> <span style="color: #000033;">;</span>
Query OK<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> rows affected <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #000099;">USER</span> <span style="color: #008000;">'ivan'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'passhere'</span><span style="color: #000033;">;</span>
Query OK<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> rows affected <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #CC0099;">*</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'ivan'</span>@<span style="color: #008000;">'localhost'</span> <span style="color: #990099; font-weight: bold;">WITH</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">OPTION</span><span style="color: #000033;">;</span>
Query OK<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> rows affected <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> flush <span style="color: #990099; font-weight: bold;">privileges</span><span style="color: #000033;">;</span>
Query OK<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> rows affected <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span>
&nbsp;
mysql<span style="color: #CC0099;">&gt;</span> exit
Bye</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ivanvillareal.com/linux/mysql5-and-php5-on-centos4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

