วิธีสร้างฐานข้อมูล และ grant
mysql -e "create database hos"
mysql -e "grant all privileges on hos.* to sa@'%' identified by '71'"
mysql -e "grant all privileges on *.* to sa@'%' identified by '71' with grant option"
hos = ฐานข้อมูล
sa = user
71 = password
วิธี restore ข้อมูลบน linux
echo restore old database
mysql hos < /root/hos.sql
วิธี backup ข้อมูล linux
echo dump old mysql data
mysqldump hos > /root/hos.sql
mysqldump --opt --default-character-set=tis620 --force --allow-keywords --single-transaction --ignore-table=hos.replicate_log -h 192.168.100.254 -u sa -psa hos > /var/backup/hos.sql
| gzip /root/backup/hos.gz