Mounting ram as a working space which help I/O faster.
#mkdir -p /tmp/ram#sudo mount -t tmpfs -o size=512M tmpfs /tmp/ram/
However, be careful to not exceed the memory you have in the system.
http://www.ubuntuka.com/ubuntu-ramdisk-ramdrive-easy-way/
A brief short linux how to and problem solving. This blog is intended to be a reference by summarizing from reliable data source and my experience. Readers should have a basic understanding about linux.
#mkdir -p /tmp/ram#sudo mount -t tmpfs -o size=512M tmpfs /tmp/ram/
#sudo apt-get install php5-dev php5-cli php-pear
#sudo pecl install mongo
Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10genYou're ready to install :
#apt-get update#apt-get install mongodb-10genThe mongodb is running in the system. The configuration for mongodb is /etc/mongodb.conf and in /etc/init/mongodb.conf (for startup script)
mysql> CREATE table if not exists tblname like old_tblname;
mysql> INSERT INTO tblname1 SELECT * from tblname2 where ...;
mysql> TRUNCATE table story_longcon_40;
mysql> DROP TABLE tblname;
mysql> DROP {DATABASE | SCHEMA} [IF EXISTS] db_nameOptimize Table
mysql> OPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_nam
mysql> purge binary logs to 'master-bin.000081';
mysql> START SLAVE [thread_type [, thread_type] ... ]or
mysql> START SLAVE [SQL_THREAD] UNTIL
MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos
#mysqldump dbname tblnameNot suitable for huge backup. Both table structure and the data are stored together.(option available)
mysql> SELECT * INTO OUTFILE '/tmp/t1.txt'
-> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-> LINES TERMINATED BY '\n'
-> FROM test.t1
mysql> LOAD DATA INFILE '/tmp/t1.txt'*parallel dump: maatkit(mk-parallel-dump)
-> INTO TABLE test1.t1
-> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-> LINES TERMINATED BY '\n';
server# mysqldump -uroot -p dbname tblname -dwith this method you will get sql statement. You can use this for backing up table definition as well.
mysql> create table if not exists tblname like old_tblname;with this method you get a copy of table. It is useful if you want to have a another table with the same structure for backing up, testing.