[Voyage-linux] Running MySQL on memory
Michael Fung
(spam-protected)
Mon Nov 9 12:32:28 HKT 2009
WARNING: This e-mail has been altered by MIMEDefang. Following this
paragraph are indications of the actual changes made. For more
information about your site's MIMEDefang policy, contact
OZO MIMEDefang Administrator <abuse at ozo.com>. For more information about MIMEDefang, see:
http://www.roaringpenguin.com/mimedefang/enduser.php3
An attachment named 'backup-mydb.sh'
was converted to 'defang-1.binary'.
If you do not EXPECT a binary file from a KNOWN person there is
a 99% chance that this file may contain a VIRUS. You should also
be aware that many viruses hide using a FAKE SENDER mail address
in order to make you open the file
If you decide to open this file, we strongly recommend to have
an updated anti-virus program running. You can rename the file
to its original name by a right-click on the attachment and then
Save As: 'backup-mydb.sh'
-------------- next part --------------
Hello all,
I have an application that updates the data tables heavily. I worked out these and may be someone need it too.
Put backup-mydb.sh in /usr/local/bin
Edit and run the backup-mydb.sh script (set ROOTPW, ...etc)
Create mount point for new datadir:
Edit /etc/fstab , add lines:
# for mysql:
tmpfs /var/mysqldata tmpfs defaults,size=16M 0 2
run:
mount /var/mysqldata
df -h
You see this line in the output:
tmpfs 16M 1.2M 15M 8% /var/mysqldata
shutdown mysql, run:
invoke-rc.d mysql stop
Edit /etc/mysql/my.cnf, set
datadir = /var/mysqldata
replace /etc/init.d/mysql with the attached modified version.
(the modified one is based on 5.0.51a-24+lenny2)
start mysql, run
invoke-rc.d mysql start
The script will automatically restore all data files to /var/mysqldata
You can also run backup-mydb.sh by cron periodically.
Next time when you normally shutdown the system, the data files is auto backed up.
When the system restart, the data files is auto restored.
Your comments are welcome.
- Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql
Type: application/octet-stream
Size: 6970 bytes
Desc: not available
Url : http://list.voyage.hk/pipermail/voyage-linux/attachments/20091109/0976a3d8/mysql-0003.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: defang-1.binary
Type:
Size: 519 bytes
Desc: defang-1.binary
Url : http://list.voyage.hk/pipermail/voyage-linux/attachments/20091109/0976a3d8/defang-1-0001.txt
More information about the Voyage-linux
mailing list