How to optimize big database

How to optimize big database

گروه آموزشی مجموعه تدبیر

i already made it optimize/repair it using myisamchk command line from ssh, i recommend vbulletin or some one create a instruction for optimize/repair large database table (1Gb or more), since i dont found working instruction in vb.com or vb.org


so here is what i do exactly based from snake1100 guide and other resources, it is working for me, but please let me know if you have more advice from this steps, i believe this will be really helping many of us :

1. ssh into server

2. Stop the MySQL server (it is needed to stop the mysql server to do this right?)
/etc/rc.d/init.d/mysql stop

3. cd to mysql’s data dir (or if you know your path) : 
cd /var/lib/mysql/database_name/

4a. 
myisamchk -o /var/lib/mysql/database_name/post.* –> i try this, but its say not working, get message like this “Try fixing it by using the –safe-recover (-o), the –force (-f) option or by not using the –quick (-q) flag

so i add -f and its working to repair the post table in 5 hours :
myisamchk -o -f /var/lib/mysql/database_name/post.*

4b. 
myisamchk -r /var/lib/mysql/database_name/post.* (its possible at this point you may need to use the “-o” option) –> I am still didnt doing this, since step 4a is already working, do i still need do this step guys?

5. Restart MySQL again:
/etc/rc.d/init.d/mysql start