<?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>Corpocrat Blog &#187; Linux/Unix</title>
	<atom:link href="http://corpocrat.com/category/linuxunix/feed/" rel="self" type="application/rss+xml" />
	<link>http://corpocrat.com</link>
	<description>Daily Blog from Internet Entrepreneur/Webmaster</description>
	<lastBuildDate>Fri, 03 Feb 2012 10:57:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Difference between /etc/hosts and /etc/hostname</title>
		<link>http://corpocrat.com/2011/03/09/difference-between-etchosts-and-etchostname/</link>
		<comments>http://corpocrat.com/2011/03/09/difference-between-etchosts-and-etchostname/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 13:46:02 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2502</guid>
		<description><![CDATA[<p>I have often found myself in difficult situations without knowing what exactly is the difference between host and hostname</p>
<p>/etc/hostname -&#62; Assigns a name to local machine and you can set the name of the machine by editing this file. It can be a FQDN eg. vps.example.com. You will also need ...]]></description>
			<content:encoded><![CDATA[<p>I have often found myself in difficult situations without knowing what exactly is the difference between host and hostname</p>
<p><strong>/etc/hostname</strong> -&gt; Assigns a name to local machine and you can set the name of the machine by editing this file. It can be a FQDN eg. vps.example.com. You will also need to edit /etc/sysconfig/network to specify the hostname in Centos, if /etc/hostname is missing etc.</p>
<p><strong>/etc/hosts</strong> -&gt; Maps hostnames to IP addresses locally. It has nothing to do with DNS or FQDN. You have to specify hostname and IP address for resolving on line by line.</p>
<blockquote><p>67.1.2.3.5 vps.example.com  vps vps</p></blockquote>
<p>Imagine this, you are on a server disconnected from the internet and when you type vps.example.com on your browser, it resolves to the IP you specified on the /etc/hosts file.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/03/09/difference-between-etchosts-and-etchostname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run FTP server on different port!</title>
		<link>http://corpocrat.com/2011/03/08/how-to-run-ftp-server-on-different-port/</link>
		<comments>http://corpocrat.com/2011/03/08/how-to-run-ftp-server-on-different-port/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 12:40:05 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2496</guid>
		<description><![CDATA[<p>Most FTP servers use a common port number 21 by default. However using default port are subjected to many brute force attacks including many breakin attempts. It is a good idea to move FTP  port to any other random number above 1024 because ports 1-1024 are reserved ports. It is ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://corpocrat.com/wp-content/uploads/2011/03/linftp.png"><img class="size-full wp-image-2617 alignleft" title="linftp" src="http://corpocrat.com/wp-content/uploads/2011/03/linftp.png" alt="" width="189" height="123" /></a>Most FTP servers use a common port number 21 by default. However using default port are subjected to many brute force attacks including many breakin attempts. It is a good idea to move FTP  port to any other random number above 1024 because ports 1-1024 are reserved ports. It is very easy to change port number</p>
<p>To change Proftp port, open the config file <strong>/etc/proftpd.conf</strong> and change the port number this line</p>
<blockquote><p># Port 21 is the standard FTP port for Proftpd.<br />
Port                            3535</p></blockquote>
<p>For Pure-FTP open the config file /etc/pure-ftpd/pure-ftpd.conf, change port 21 to our desired port</p>
<blockquote><p># IP address/port to listen to (default=all IP and port 21).<br />
# Bind                      127.0.0.1,3535</p></blockquote>
<p>Be sure to permit your newly assigned port number through your firewall. Once this is done you can block port 21 using firewall. From now on you will need to mention our new port using ftp client like filezilla.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/03/08/how-to-run-ftp-server-on-different-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protection against Pureftpd Brute force attacks in Cpanel</title>
		<link>http://corpocrat.com/2011/03/04/protection-against-pureftpd-brute-force-attacks-in-cpanel/</link>
		<comments>http://corpocrat.com/2011/03/04/protection-against-pureftpd-brute-force-attacks-in-cpanel/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 14:56:31 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[cpanel brute force]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2471</guid>
		<description><![CDATA[<p>I have spotted kind of brute force guessing attacks in my logs attempted against my ftp server. The attacks come from different IPs and the failed login attempts are of combination of username and passwords.I did run AFP + BFD (brute force detection) but BFD isnt working on my linux ...]]></description>
			<content:encoded><![CDATA[<p>I have spotted kind of brute force guessing attacks in my logs attempted against my ftp server. The attacks come from different IPs and the failed login attempts are of combination of username and passwords.I did run AFP + BFD (brute force detection) but BFD isnt working on my linux box against ftp attacks.</p>
<p>If you are looking for somekind of way to stop these attacks, luckily cpanel comes with cpHulk which offers brute force prevention. All you have to do is just ENABLE it because it isnt enabled by default. If you cant locate cpHulk in WHM, just type &#8216;hulk&#8217; in search box.</p>
<p><a href="http://corpocrat.com/wp-content/uploads/2011/03/cphulk.png"><img class="alignnone size-full wp-image-2474" title="cphulk" src="http://corpocrat.com/wp-content/uploads/2011/03/cphulk.png" alt="" width="517" height="211" /></a></p>
<p>Once you have enabled the cpHulk, you can set your preferences on number of login attempts and its easy!</p>
<p><a href="http://corpocrat.com/wp-content/uploads/2011/03/Screen-shot-2011-03-04-at-8.16.39-PM.png"><img class="alignnone size-full wp-image-2472" title="Screen shot 2011-03-04 at 8.16.39 PM" src="http://corpocrat.com/wp-content/uploads/2011/03/Screen-shot-2011-03-04-at-8.16.39-PM.png" alt="" width="582" height="388" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/03/04/protection-against-pureftpd-brute-force-attacks-in-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL delete is very slow and takes long time!</title>
		<link>http://corpocrat.com/2011/02/07/mysql-delete-is-very-slow-and-takes-long-time/</link>
		<comments>http://corpocrat.com/2011/02/07/mysql-delete-is-very-slow-and-takes-long-time/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 08:18:27 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[mysql delete slow]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2422</guid>
		<description><![CDATA[<p></p>
<p>I recently had an issue with mysql database and the datbase has grown too large about 200k records and i was needing to delete all junk and needless data of approx 50k rows in my table. As soon as i hit delete sql query using WHERE clause, it almost took ...]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2011/02/mysql.png"><img title="mysql" src="/wp-content/uploads/2011/02/mysql.png" alt="" width="200" height="103" /></a></p>
<p>I recently had an issue with mysql database and the datbase has grown too large about 200k records and i was needing to delete all junk and needless data of approx 50k rows in my table. As soon as i hit delete sql query using WHERE clause, it almost took about 1 hr and the task was still running and i noticed that the query was able to do delete of only 10k rows which to me is amazingly slow.</p>
<p>Running this DELETE query had locked all tables causing the site to go down and users see &#8220;Too many sql connections&#8221; and the server load was almost at 35/1.0</p>
<blockquote><p>Always Run DELETE for large rows using LIMIT</p></blockquote>
<p>I had to resort to killing the mysql process and restart the mysql server to bring back the site online. So never use delete directly on large datasets without using LIMIT because it puts enormous load on your server. You can set limit to either 100 rows or 1000 rows not more than that.</p>
<blockquote><p>DELETE from &lt;tbldata&gt; where date &lt;= &#8217;2009&#8242; LIMIT 500</p></blockquote>
<p>I did quite a research on using delete and it turns out that delete is amazingly slow on databases and the only way is to run delete on small chunks of data. You can write a php script running as cron which execute delete when the server is idle.</p>
<blockquote><p>Keep in mind that running DELETE will LOCK your tables. So perform this operation only when the server is idle.</p>
<h3>So whats the solution?</h3>
<p>The only way you can clean up your table is using the following methods.</p>
<p>1. Apply DELETE on small chunks of rows usually by limiting to max 10000 rows. Do this only your server is IDLE.</p>
<p>2. Make sure you create INDEX in your table on the auto_increment primary key and this way delete can<strong> speed up</strong> things enormously.  I created a index on certain fields in the table and ran DELETE with LIMIT 10000 and it took about 1.2 second to perform the operation which is just fine i guess.</p>
<p>2. Another method is copy the data you want to save to a new table, and then use TRUNCATE on the old table and then copy back. This way your users will see less down time and this method is the fastest although its bit indirect.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/02/07/mysql-delete-is-very-slow-and-takes-long-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install a local copy and configure WordPress on Ubuntu</title>
		<link>http://corpocrat.com/2011/01/29/how-to-install-a-local-copy-and-configure-wordpress-on-ubuntu/</link>
		<comments>http://corpocrat.com/2011/01/29/how-to-install-a-local-copy-and-configure-wordpress-on-ubuntu/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 19:10:18 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2398</guid>
		<description><![CDATA[<p></p>
<p>Compatibility is one of the most important issues when it comes to WordPress. If you want to install a a copy on your local machine, then you have to follow some simple steps.</p>
<p>First, download the archive on wordpress.org. For the purpose of this tutorial we are going to use wordpress-2.9.tar.gz ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://corpocrat.com/wp-content/uploads/2011/01/ubuntu.png"><img class="alignnone size-full wp-image-2429" title="ubuntu" src="http://corpocrat.com/wp-content/uploads/2011/01/ubuntu.png" alt="" width="256" height="82" /></a></p>
<p>Compatibility is one of the most important issues when it comes to WordPress. If you want to install a a copy on your local machine, then you have to follow some simple steps.</p>
<p>First, download the archive on wordpress.org. For the purpose of this tutorial we are going to use wordpress-2.9.tar.gz archive, which is usually automatically saved in / home / username / Downloads.<br />
Open a new Terminal and create a wordpress folder in / home / username with the command</p>
<p><code>mkdir wordpress</code></p>
<p>Being in the username folder, and make sure you have full rights on wordpress folder. You can do this by using the command</p>
<p><code>chmod 777 wordpress</code></p>
<p>Before writing the actual commands we must have that specific folder in the path of the terminal. Navigation is very similar to Windows, including the cd with no parameters to access the home folder  or cd / path / folder to access a certain path.</p>
<p>Using this simple command, we navigate to the folder where wordpress-2.9.tar.gz is situated and we write the command:</p>
<p><code>wordpress-2.9.tar.gz cp / home / nume_user / wordpress</code></p>
<p>This will copy the archive to the wordpress folder. Then we move into the wordpress folder (cd / home / user_name / wordpress) where we write the unzip command:</p>
<p><code>tar-zxvf wordpress-2.9.tar.gz</code></p>
<p>This will create another folder in wordpress with the same name, which will be necessary to install the actual copy on your local machine. You can also rename this folder using:</p>
<p><code>mv wordpress the_name_you_want</code></p>
<p>Previous commands can also be accessed very easily from the GUI, but for those who want to develop in Linux it is better to learn the basic commands in Terminal. The Apache server accesses the files in / var / www, so we cannot install WordPress locally, until we change the settings for Apache.</p>
<p><code>sudo gedit / etc/apache2/apache2.conf</code></p>
<p>We use sudo because this is a file that only the administrator of your machine can access. You will also be asked for the root password after pressing enter. Next, in apache2.conf we write the following lines:<br />
<a href="http://corpocrat.com/wp-content/uploads/2011/01/wpubuntu.png"><img class="alignnone size-full wp-image-2399" title="wpubuntu" src="http://corpocrat.com/wp-content/uploads/2011/01/wpubuntu.png" alt="" width="552" height="447" /></a></p>
<p>Save and access in the Terminal: sudo gedit / etc / hosts adding a line with 127.0.0.1 Where and www.wordpress.ro.im.localhost. Restart apache:</p>
<p><code>sudo / etc/init.d/apache2 restart</code></p>
<p>Thus configured, we can access the website at <a href="http://www.wordpress.ro.im.localhost/">http://www.wordpress.ro.im.localhost</a>. This allows the installation of multiple platforms of wordpress and their separate configurations. Furthermore, the actual location for each will be in / home / user_name / wordpress / website_name.</p>
<h3>About Author:</h3>
<p><span style="color: #888888;"> <span style="color: #333333;">Brad&#8217;s a Linux enthusiast and is currently working on migrating his     latest project (made in WordPress), <a href="http://Findermind.com">Findermind.com</a> to a new Ubuntu     dedicated server.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/01/29/how-to-install-a-local-copy-and-configure-wordpress-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to import text data in mysql with spaces?</title>
		<link>http://corpocrat.com/2011/01/09/how-to-import-text-data-in-mysql-with-spaces/</link>
		<comments>http://corpocrat.com/2011/01/09/how-to-import-text-data-in-mysql-with-spaces/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 14:26:23 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[PHP Scripts]]></category>
		<category><![CDATA[import text data mysql]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2383</guid>
		<description><![CDATA[<p></p>
<p>Lets say you have to import a large text file to mysql and fields are totally irregular but only separated by spaces. For example.  Since it is only text file and highly irregular data you have to use other methods to import data to database.</p>
<p>17876           ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://corpocrat.com/wp-content/uploads/2011/02/mysql.png"><img class="alignnone size-full wp-image-2423" title="mysql" src="http://corpocrat.com/wp-content/uploads/2011/02/mysql.png" alt="" width="200" height="103" /></a></p>
<p>Lets say you have to import a large text file to mysql and fields are totally irregular but only separated by spaces. For example.  Since it is only text file and highly irregular data you have to use other methods to import data to database.</p>
<blockquote><p>17876           BILL            hc-device          4.76                FC900888        0.88776           USD</p></blockquote>
<p>There are 3 ways to import text data into mysql</p>
<h3>1. Use a fixed width data import method</h3>
<p>Try to analyse and measure the data in text file and you will have a brief idea on length of fields.</p>
<pre>LOAD DATA LOCAL
INFILE '&lt;file name&gt;' INTO TABLE &lt;table&gt;
(@var1)
SET
 `name`=SUBSTR(@var1,1,25),
 `address`=SUBSTR(@var1,26,25),
 `zip`=SUBSTR(@var1,51,10),
 `phone`=SUBSTR(@var1,61,10)
IGNORE 35 LINES</pre>
<h3>2.  MySQL Load Data INFILE method</h3>
<p>Usually mysql does not interpret multiple spaces as one, you have to group all spaces first using sed command line, then you can import using load data infile.</p>
<blockquote>
<pre><code>sed 's/ \+/ /g' thefile &gt; thefile.new

</code></pre>
</blockquote>
<p>The above command groups all spaces into one and (the regular expression does it) and the resulting data is output written into new file. Once done we can feed  the new file to load data infile.</p>
<pre>
<blockquote>
<pre><code>LOAD DATA INFILE '&lt;filename&gt;' INTO TABLE &lt;table&gt;
FIELDS TERMINATED BY ' '
LINES TERMINATED BY '\n';
</code></pre>
</blockquote>
</pre>
<h3>3. Parsing a text file using PHP</h3>
<p>You can parse the text file using preg_split and matching regular expressions using php. The code below will separate columns separated by spaces.</p>
<pre class="brush: php; title: CODE; notranslate">

&lt;?php

$fileHandle= @fopen(&quot;data.txt&quot;, &quot;r&quot;);
if ($fileHandle) {
 while (!feof($fileHandle)) {
 $i++;
 $lines = fgets($fileHandle, 4096);

 $columns = preg_split(&quot;/\s+/&quot;, $lines);
 if(preg_match('/[0-9]+/', $columns[1])) {
 echo $columns[0] . '---&gt; '. $columns[1] . ' = '. $columns[2] . $columns[3] . $columns[4] .'&lt;br&gt;';
 // Once columns isolated, you can insert into mysql

mysql_query(&quot;INSERT into &lt;table&gt; (col1,col2,col3) VALUES (columns[0], columns[1]. columns[2])&quot;) or die(mysql_error());
}

}
 fclose($fileHandle);
}

?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/01/09/how-to-import-text-data-in-mysql-with-spaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to use LOAD DATA INFILE to import fixed width data in MySQL</title>
		<link>http://corpocrat.com/2011/01/09/ho-to-use-load-data-infile-to-import-fixed-width-data-in-mysql/</link>
		<comments>http://corpocrat.com/2011/01/09/ho-to-use-load-data-infile-to-import-fixed-width-data-in-mysql/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 11:49:35 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[PHP Scripts]]></category>
		<category><![CDATA[mysql load data]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2380</guid>
		<description><![CDATA[<p>It is very easy to import fixed width CSV data into your mysql database and LOAD DATA INFILE is the fastest method i have seen. If you are on shared hosting be sure you first upload the csv file to your hosting server and specify LOCAL if not you will ...]]></description>
			<content:encoded><![CDATA[<p>It is very easy to import fixed width CSV data into your mysql database and LOAD DATA INFILE is the fastest method i have seen. If you are on shared hosting be sure you first upload the csv file to your hosting server and specify LOCAL if not you will get permission denied error.</p>
<blockquote>
<pre>LOAD DATA LOCAL
INFILE '&lt;file name&gt;' INTO TABLE &lt;table&gt;
(@var1)
SET
 `name`=SUBSTR(@var1,1,25),
 `address`=SUBSTR(@var1,26,25),
 `zip`=SUBSTR(@var1,51,10),
 `phone`=SUBSTR(@var1,61,10)
IGNORE 35 LINES
</pre>
</blockquote>
<p>If you want to just update the database using latest CSV data, specify REPLACE.  The SUBSTR() function extracts the data and it accepts first variable, then position starting from and then no of characters to extract. If you want to skip useless data in first 35 lines, you can specify IGNORE 35 lines at the bottom.</p>
<blockquote>
<pre>
LOAD DATA LOCAL
INFILE '&lt;file name&gt;'
REPLACE INTO TABLE &lt;table&gt;
(@var1)
SET `name`=SUBSTR(@var1,1,25), `address`=SUBSTR(@var1,26,25),
`zip`=SUBSTR(@var1,51,10), `phone`=SUBSTR(@var1,61,10)
IGNORE 35 LINES</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/01/09/ho-to-use-load-data-infile-to-import-fixed-width-data-in-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL database without primary key is too slow!</title>
		<link>http://corpocrat.com/2011/01/08/mysql-database-without-primary-key-is-too-slow/</link>
		<comments>http://corpocrat.com/2011/01/08/mysql-database-without-primary-key-is-too-slow/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 23:08:33 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[mysql slow]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2377</guid>
		<description><![CDATA[<p>I cant believe how slow the performance of mysql was, assuming that  i had a large database table of over 100k record. I technically directly imported to mysql from csv and there was no primary key in the database. Infact i never used a auto incrementing primary key.</p>
<p>The performance was ...]]></description>
			<content:encoded><![CDATA[<p>I cant believe how slow the performance of mysql was, assuming that  i had a large database table of over 100k record. I technically directly imported to mysql from csv and there was no primary key in the database. Infact i never used a auto incrementing primary key.</p>
<p>The performance was too slow and some pages took over 5 seconds to load. i had a suspicion that missing primary key is causing this slowness and quickly created auto increment id and a full text index. I got a significant boost in performance and there was never slowness after this.</p>
<p>From this experience, i learnt  how important is primary key for mysql performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/01/08/mysql-database-without-primary-key-is-too-slow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix -&gt; MySQL LOAD DATA Infile &#8211; Access Denied using password YES</title>
		<link>http://corpocrat.com/2011/01/08/fix-mysql-load-data-infile-access-denied-using-password-yes/</link>
		<comments>http://corpocrat.com/2011/01/08/fix-mysql-load-data-infile-access-denied-using-password-yes/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 22:18:42 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[PHP Scripts]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=2375</guid>
		<description><![CDATA[<p>I was on shared hosting and thought i could import a CSV file using PHP to mySQL database and whe</p>
 LOAD DATA INFILE '/home7/topbestg/OFFICES2_ALL.CSV'
 REPLACE INTO TABLE `tbl`
 FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
 LINES TERMINATED BY '\n'
 IGNORE 1 LINES;

<p>i was thrown this error</p>
<p>Access Denied user@localhost using password ...]]></description>
			<content:encoded><![CDATA[<p>I was on shared hosting and thought i could import a CSV file using PHP to mySQL database and whe</p>
<pre> LOAD DATA INFILE '/home7/topbestg/OFFICES2_ALL.CSV'
 REPLACE INTO TABLE `tbl`
 FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
 LINES TERMINATED BY '\n'
 IGNORE 1 LINES;
</pre>
<p>i was thrown this error</p>
<blockquote><p>Access Denied user@localhost using password YES</p></blockquote>
<h3>Fix:</h3>
<p>Just add LOCAL to your load data statement and be sure the csv file you are trying to import on your local server</p>
<blockquote>
<pre>LOAD DATA LOCAL INFILE '/home/ex/DATA.CSV'
 REPLACE INTO TABLE `tbl`
 FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
 LINES TERMINATED BY '\n'
 IGNORE 1 LINES;</pre>
</blockquote>
<p>and bingo! it worked like a charm!</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2011/01/08/fix-mysql-load-data-infile-access-denied-using-password-yes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy way to setup CRON jobs in CPanel without Email output</title>
		<link>http://corpocrat.com/2010/11/15/setup-automatic-cron-jobs-in-cpanel-with-no-emails/</link>
		<comments>http://corpocrat.com/2010/11/15/setup-automatic-cron-jobs-in-cpanel-with-no-emails/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 11:51:24 +0000</pubDate>
		<dc:creator>pbu</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[cpanel cron jobs]]></category>

		<guid isPermaLink="false">http://corpocrat.com/?p=1842</guid>
		<description><![CDATA[<p>i have been looking everywhere for one easy command to setup CRON job in cpanel.  My requirement was i wanted to send a simple invoice for my client every month and i dont want want cron outputs to sent as junk to my email.</p>
<p>Here is this one command which worked ...]]></description>
			<content:encoded><![CDATA[<p>i have been looking everywhere for one easy command to setup CRON job in cpanel.  My requirement was i wanted to send a simple invoice for my client every month and i dont want want cron outputs to sent as junk to my email.</p>
<p>Here is this one command which worked very neatly work. I created a simple php file to send email and i dont want the php file to be accessed by public and bots by placing in public_html folder because placing it openly is susceptible to spam. so i placed the file above public_html folder so that it is not accessed by public.</p>
<p>Here is this command you have to add</p>
<p><code>php -q /home/pbu/cron/laterooms.php &gt; /dev/null</code></p>
<p>and from the below shown image, this above commands runs on 15th of every month running the php file. Note that i have created a separate folder cron just to organize the cron jobs.</p>
<p><a href="http://corpocrat.com/wp-content/uploads/2010/11/cron2.png"><img class="alignnone size-full wp-image-1844" title="cron2" src="http://corpocrat.com/wp-content/uploads/2010/11/cron2.png" alt="" width="531" height="144" /></a></p>
<p>You can also use another command wget to run a cron job, but that will send you irritating emails everytime the php script is run.</p>
<p><code>wget -O /dev/null http://www.prurgent.com/news/rss.php</code></p>
<p>CRON worked like a charm running automated scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://corpocrat.com/2010/11/15/setup-automatic-cron-jobs-in-cpanel-with-no-emails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

