Posts tagged mysql

MySQL: Repair & Optimize all Tables in all Databases


MySQL tables can crash quite easily, especially when your server unexpectedly shuts down or crashed, or when you're forced to copy data around when it's still being accessed.

Luckily, there's a simple command to automatically check, repair and optimize all tables in all databases when you're running a MySQL server on Linux / Unix / BSD.

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

That's all there is to it!

Best Webhost


Are you looking to create a website and have your own webhost? It is very simple but the first step is to find a dependable webhost company. We tried over 10 webhost companies (Servage, GoDaddy, Hostmonster, Blue host and may more) in the past 8 years and found the most affordable and dependable was DreamHost

There is nothing to loose you always have your 97 days money back grantee but further if you use our promo coupon you can take 90 USD OFF just use promotional discount coupon code: 





That gives you a One Year webhost for only 29.40 bucks.

Below is a table comparing popular webhosts and any hidden limtations they have. If you have updates to this please comment.

Feature Dreamhost Hostmonster GoDaddy (Delux)
Price/Month $8.95 $6.95 $6.99
Price Promo 1yr $107.4-90=$17.4 /first year Adhoc 5.95$x12=$71.4 $6.64×12=$79.68
Host Unlmited Domains Yes Yes Yes
Hosting Space Unlimited “Unlimited” but if high your account will be suspended 150GB
Bandwidth Unlimited Unlimited 1500GB
SSH Access By Default Need to send ID Can be requested no ID needed
CPU Limit No Limitation 60Sec then Site suspended No Limitation
Uptime 99.9 99.9 99.9
MYSQL Databases Unlimited 100 25
Email Accounts Unlimited Unlimited Unlimited
First Yr Domain Registration Free Yes Yes No
Custom Cronjob Yes Yes Yes
Tech Support Chat, Email Ticket system(response time: 1-24hours),Phone: only call back Phone, Chat, Ticket(Response time 1-24 Hours) Phone,Ticket(slow 1 Day response time)
Install Custom PHP Yes Simple see article here No No
Max File Upload Size 7MB, unlimited with Custom PHP install 2MB, can be increased with copying php to all folders, still limited with CPU time limit 7MB
Can host Adult Content Yes No Yes
Loading speed for a 64kb website size 2-3 Seconds performance is stable since dreamhost upgraded to new servers 2-3 Seconds, performance was stable 5-6 Seconds
Midnight Commander Installed by default Not installed and can not install it Not sure

Upgrading PHP version on Centos from 2.5.10 to


FIREWALL[root@CentOS-56-64-minimal ~]# system-config-securitylevel-tui


Solution in Centos 5 and Fedora 9:

Through SSH:
yum search mbstring

yum install php-mbstring

/etc/init.d/httpd restart


vi /etc/my.cnf

How to automatically add row number in query result? (Mysql)


Here’s how you do it:

select @rownum:=@rownum+1 ‘rank’, p.* from player p, (SELECT @rownum:=0) r order by score desc limit 10;

Try it …..

Commands using iconv to fix website Characters

Here are some useful SSH commands to fix special characters on your website.
Sometimes you would see ? or strange charsets…
Recommended to use UTF-8 and have your database collation also as utf-8
Convert a bunch of HTML files from ISO-8859-1 to UTF-8 file encoding in a folder and all sub-folders
for x in `find . -name ‘*.html’` ; do iconv -f ISO-8859-1 -t UTF-8 $x > “$x.utf8”; rm $x; mv “$x.utf8” $x; done
Convert mysql database from latin1 to utf8
mysqldump –add-drop-table -uroot -p “DB_name” | replace CHARSET=latin1 CHARSET=utf8 | iconv -f latin1 -t utf8 | mysql -uroot -p “DB_name”
find . -name “*.php” -exec iconv -f ISO-8859-1 -t UTF-8 {} -o ../newdir_utf8/{} \;
Batch convert files to utf-8
iconv -f ISO8859-1 -t UTF-8 OLDFILE > NEWFILE

For example in ssh type:
iconv -f ISO8859-1 -t UTF-8 listing_default.tpl >listing_default2.tpl

Then rename or delete your old listing_default.tpl and rename listing_default2.tpl to listing_default.tpl
Go to Top