<?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>Linux, MySQL, PhP, Perl... &#187; Mysql</title>
	<atom:link href="http://linux.bgsnow.com/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://linux.bgsnow.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 16:30:03 +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>MySQL Normalization</title>
		<link>http://linux.bgsnow.com/mysql-normalization.php</link>
		<comments>http://linux.bgsnow.com/mysql-normalization.php#comments</comments>
		<pubDate>Sat, 05 Jun 2010 19:42:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[database normalization]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=249</guid>
		<description><![CDATA[Database normalization prevents redundancy, inconsistency and data loss. It includes several steps as follows: 1. 1NF - First Normal Form states that all tuple values should be atomic. Atomic means that there should be only one useful piece of data for each attribute. The first step in database normalization is to determine the functional dependencies in the database. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Database normalization</strong> prevents redundancy, inconsistency and data loss. It includes several steps as follows:</p>
<p>1. 1NF - First Normal Form states that all tuple values should be atomic. Atomic means that there should be only one useful piece of data for each attribute.</p>
<p>The first step in database normalization is to determine the <strong>functional dependencie</strong>s in the database. This means to find which values are determined by which.</p>
<p>2. Decomposition and <strong>Boyce/Codd Normal Form</strong></p>
<p>BCNF has only one requirement - every <strong>functional dependency</strong> must be functionally determined by either a <strong>candidate key*</strong>, or a <em>superset</em> of a candidate key( <strong>superkey)</strong>.</p>
<p>*A <strong>candidate key</strong> is a set of attributes that must be <em>unique</em> for each tuple and <em>irreducible</em> into a smaller key.</p>
<p>Example:</p>
<p>candidate_key -&gt; value</p>
<p>candidate_key2 -&gt; value2</p>
<p>...</p>
<p>5. <strong>5th Normal Form</strong> requires that each join dependency is satisfied by superkeys.</p>
<p>A <strong>join dependency</strong>(<strong>JD) </strong>is a set of projections on a relation which when joined reform the original relation.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/mysql-normalization.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text Files and MySQL databases</title>
		<link>http://linux.bgsnow.com/csv_mysql_database.php</link>
		<comments>http://linux.bgsnow.com/csv_mysql_database.php#comments</comments>
		<pubDate>Sun, 23 May 2010 19:06:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[INTO OUTFILE]]></category>
		<category><![CDATA[LOAD DATA]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=240</guid>
		<description><![CDATA[If for some strange reason you have to import CSV file directly into MySQL here is a good query to go: mysql&#62; LOAD DATA INFILE 'file.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (column1, column2); It gives you all the options such as how fields are terminated, [...]]]></description>
			<content:encoded><![CDATA[<p>If for some strange reason you have to import CSV file directly into MySQL here is a good query to go:</p>
<p>mysql&gt; LOAD DATA INFILE 'file.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (column1, column2);</p>
<p>It gives you all the options such as how fields are terminated, enclosed and so on. The above example is specific for a csv file created with a Windows Text Editor. (windows... haha)</p>
<p>Similarly, if you have to export a query into a text file here is how this can be done:</p>
<p>mysql&gt; SELECT column1, column2 INTO OUTFILE 'file.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'LINES TERMINATED BY '\r\n' FROM table_name;</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/csv_mysql_database.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced MySQL Priveleges</title>
		<link>http://linux.bgsnow.com/advanced-mysql-priveleges.php</link>
		<comments>http://linux.bgsnow.com/advanced-mysql-priveleges.php#comments</comments>
		<pubDate>Sun, 23 May 2010 18:08:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=230</guid>
		<description><![CDATA[MySQL privileges assignment is a complex process which allows you to set different privileges for an user for different tables/databases. However, this process is very often neglected and users are granted with all privileges for a whole database. If improper privileges are applied this can lead to a website being hacked via MySQL. This means [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL privileges assignment is a complex process which allows you to set different privileges for an user for different tables/databases. However, this process is very often neglected and users are granted with all privileges for a whole database.</p>
<p>If improper privileges are applied this can lead to a website being hacked via MySQL. This means that the attacker executes a MySQL query which either illegally retrieves, updates or inserts information.</p>
<p>Thus when you manually assign privileges make sure not to grant only the needed privileges to the corresponding tables. This is not always possible though since many popular web applications use just one user for everything.<br />
So here is the usual MySQL privileges granting:</p>
<p>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX ON database.* TO user@localhost IDENTIFIED BY 'password';</p>
<p>This will grant all privileges to user@localhost. However, imagine that you can divide your script into parts with different functionality. For example, user_logs would be used to read just the logs from the 'logs' table. Then his privileges should be:</p>
<p>GRANT SELECT ON database.logs TO user_logs@localhost IDENTIFIED BY 'password';</p>
<p>This will make sure that even compromised user_logs will not be able to mess with the entire database.<br />
MySQL privileges assignment is a complex process which allows you to set different privileges for an user for different tables/databases. However, this process is very often neglected and users are granted with all privileges for a whole database.</p>
<p>If improper privileges are applied this can lead to a website being hacked via MySQL. This means that the attacker executes a MySQL query which either illegally retrieves, updates or inserts information.</p>
<p>Thus when you manually assign privileges make sure not to grant only the needed privileges to the corresponding tables. This is not always possible though since many popular web applications use just one user for everything.</p>
<p>So here is the usual MySQL privileges granting:</p>
<p>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX ON database.* TO user@localhost IDENTIFIED BY 'password';</p>
<p>This will grant all privileges to user@localhost. However, imagine that you can divide your script into parts with different functionality. For example, user_logs would be used to read just the logs from the 'logs' table. Then his privileges should be:</p>
<p>GRANT SELECT ON database.logs TO user_logs@localhost IDENTIFIED BY 'password';</p>
<p>This will make sure that even compromised user_logs will not be able to mess with the entire database.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/advanced-mysql-priveleges.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting MySQL. ERROR! Manager of pid-file quit without updating file.</title>
		<link>http://linux.bgsnow.com/starting-mysql-error-manager-of-pid-file-quit-without-updating-file.php</link>
		<comments>http://linux.bgsnow.com/starting-mysql-error-manager-of-pid-file-quit-without-updating-file.php#comments</comments>
		<pubDate>Sat, 14 Nov 2009 21:11:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[/var/lib/mysql]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[pid-file]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=195</guid>
		<description><![CDATA[I got that nasty error after moving around different directories in /var/lib/mysql: root@server:/var/lib/mysql# /etc/init.d/mysql start Starting MySQL. ERROR! Manager of pid-file quit without updating file. There were all kind of suggestions about it on the net, most of which had something to do with incorrect shutdown or incorrect permissions for the pid file. One of [...]]]></description>
			<content:encoded><![CDATA[<p>I got that nasty error after moving around different directories in /var/lib/mysql:</p>
<p><span style="color: #808080;">root@server:/var/lib/mysql# /etc/init.d/mysql start</span></p>
<p><span style="color: #808080;">Starting MySQL. ERROR! Manager of pid-file quit without updating file.</span></p>
<p>There were all kind of suggestions about it on the net, most of which had something to do with incorrect shutdown or incorrect permissions for the pid file.</p>
<p>One of the suggestions reminded me to read the mysql error log <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Here is what the error log said:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# /etc/init.d/mysql start</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Starting MySQL. ERROR! Manager of pid-file quit without updating file.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mysql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysql                       mysql_config                mysqldumpslow               mysql_idle_processes.pm     mysqlshow                   mysql_tzinfo_to_sql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqlaccess                 mysql_convert_table_format  mysql_explain_log           mysqlimport                 mysql_sock.pm               mysql_upgrade</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqladmin                  mysqld                      mysql_find_rows             mysql_install_db            mysql_tableinfo             mysql_upgrade_shell</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqlbinlog                 mysqld-debug                mysql_fix_extensions        mysql_logs.sh               mysqltest                   mysql_waitpid</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqlbug                    mysqld_multi                mysql_fix_privilege_tables  mysqlmanager                mysqltestmanager            mysql_zap</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqlcheck                  mysqld_safe                 mysqlhotcopy                mysql_secure_installation   mysqltestmanagerc</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysql_client_test           mysqldump                   mysqlhotcopy.orig           mysql_setpermission         mysqltestmanager-pwgen</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mysqld</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqld         mysqld-debug   mysqld_multi   mysqld_safe    mysqldump      mysqldumpslow</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mysqld</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqld         mysqld-debug   mysqld_multi   mysqld_safe    mysqldump      mysqldumpslow</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mysqld_safe start</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Starting mysqld daemon with databases from /var/lib/mysql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">STOPPING server from pid file /var/lib/mysql/host.server.bgsnow.com.pid</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:14:56  mysqld ended</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ll /var/lib/mysql/host.server.bgsnow.com.p</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# touch /var/lib/mysql/host.server.bgsnow.com.pid</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# chown mysql: /var/lib/mysql/host.server.bgsnow.com.pid</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# /etc/init.d/mysql start</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Starting MySQL. ERROR! Manager of pid-file quit without updating file.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# tail -f /var/lib/mysql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysql/    mysqlA/   mysqlOLD/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# tail -f /var/lib/mysql/mysql-slow.log</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">host.server.bgsnow.com.err  ib_logfile0                mysql-slow.log             optistr2_optistreams/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">ibdata1                    ib_logfile1                optistr2_opti/             optistr2_perldesk/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# tail -f /var/lib/mysql/host.server.bgsnow.com.err</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Restoring possible half-written data pages from the doublewrite</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: buffer...</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Doing recovery: scanned up to log sequence number 0 43655</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:20  InnoDB: Starting an apply batch of log records to the database...</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Apply batch completed</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:21  InnoDB: Started; log sequence number 0 43655</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:21 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:21  mysqld ended</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:52  mysqld started</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Log scan progressed past the checkpoint lsn 0 36808</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:52  InnoDB: Database was not shut down normally!</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Starting crash recovery.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Reading tablespace information from the .ibd files...</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Restoring possible half-written data pages from the doublewrite</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: buffer...</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Doing recovery: scanned up to log sequence number 0 43655</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:52  InnoDB: Starting an apply batch of log records to the database...</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">InnoDB: Apply batch completed</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:53  InnoDB: Started; log sequence number 0 43655</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:53 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">091114 13:16:53  mysqld ended</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ls</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">./  ../  host.server.bgsnow.com.err  ibdata1  ib_logfile0  ib_logfile1  mysql-slow.log  optistr2_opti/  optistr2_optistreams/  optistr2_perldesk/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ll ../</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">alternatives/     dhclient/         logrotate.status  mlocate/          mysqlA/           pgsql/            rkhunter/         sepolgen/         stateless/        yum/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">dbus/             games/            misc/             mysql/            mysqlOLD/         random-seed       rpm/              spamassassin/     texmf/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ll ../</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">alternatives/     dhclient/         logrotate.status  mlocate/          mysqlA/           pgsql/            rkhunter/         sepolgen/         stateless/        yum/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">dbus/             games/            misc/             mysql/            mysqlOLD/         random-seed       rpm/              spamassassin/     texmf/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ll ../mysqlOLD/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">cphulkd/                   host.server.bgsnow.com.err  ib_logfile0                mysql/                     roundcube/                 sentry_stat/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">eximstats/                 host.server.bgsnow.com.pid  ib_logfile1                mysql-slow.log             sentry/                    sentry_traf/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">horde/                     ibdata1                    leechprotect/              mysql.sock                 sentry_mambo/              test/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ll ../mysqlOLD/*</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# ls</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">./  ../  host.server.bgsnow.com.err  ibdata1  ib_logfile0  ib_logfile1  mysql-slow.log  optistr2_opti/  optistr2_optistreams/  optistr2_perldesk/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mv ../mysqlOLD/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">cphulkd/                   host.server.bgsnow.com.err  ib_logfile0                mysql/                     roundcube/                 sentry_stat/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">eximstats/                 host.server.bgsnow.com.pid  ib_logfile1                mysql-slow.log             sentry/                    sentry_traf/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">horde/                     ibdata1                    leechprotect/              mysql.sock                 sentry_mambo/              test/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# mv ../mysqlOLD/* ./</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mv: overwrite `./host.server.bgsnow.com.err'? y</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mv: overwrite `./ibdata1'? n</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mv: overwrite `./ib_logfile0'? n</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mv: overwrite `./ib_logfile1'? n</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mv: overwrite `./mysql-slow.log'? y</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">root@server:/var/lib/mysql# /etc/init.d/mysql restart</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Shutting down MySQL. SUCCESS!</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Starting MySQL. SUCCESS!</div>
<p><span style="color: #808080;">root@server:/var/lib/mysql# tail -f /var/lib/mysql/host.server.bgsnow.com.err </span></p>
<p><span style="color: #808080;">InnoDB: Restoring possible half-written data pages from the doublewrite</span></p>
<p><span style="color: #808080;">InnoDB: buffer...</span></p>
<p><span style="color: #808080;">InnoDB: Doing recovery: scanned up to log sequence number 0 43655</span></p>
<p><span style="color: #808080;">091114 13:16:20  InnoDB: Starting an apply batch of log records to the database...</span></p>
<p><span style="color: #808080;">InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 </span></p>
<p><span style="color: #808080;">InnoDB: Apply batch completed</span></p>
<p><span style="color: #808080;">091114 13:16:21  InnoDB: Started; log sequence number 0 43655</span></p>
<p><span style="color: #808080;">091114 13:16:21 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist</span></p>
<p><span style="color: #808080;">091114 13:16:21  mysqld ended</span></p>
<p>Obviously I have forgotten to move back the mysql directory which is responsible for the database for all privileges, databases and so on <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   So moving it back along with the rest of the core files solved the problem:</p>
<p><span style="color: #808080;">root@server:/var/lib/mysql# mv ../mysqlOLD/* ./</span></p>
<p><span style="color: #808080;">mv: overwrite `./host.server.bgsnow.com.err'? y</span></p>
<p><span style="color: #808080;">mv: overwrite `./ibdata1'? n</span></p>
<p><span style="color: #808080;">mv: overwrite `./ib_logfile0'? n</span></p>
<p><span style="color: #808080;">mv: overwrite `./ib_logfile1'? n</span></p>
<p><span style="color: #808080;">mv: overwrite `./mysql-slow.log'? y</span></p>
<p><span style="color: #00ff00;">root@server:/var/lib/mysql# /etc/init.d/mysql restart</span></p>
<p><span style="color: #00ff00;">Shutting down MySQL. SUCCESS! </span></p>
<p><span style="color: #808080;"><span style="color: #00ff00;">Starting MySQL. SUCCESS!</span><span style="color: #00ff00;"> </span></span></p>
<p>Thus if you have similar problems, the first thing is to check the MySQL error log and don't believe the misleading error about the PID <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/starting-mysql-error-manager-of-pid-file-quit-without-updating-file.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
