The server OS is CentOS, with Memcached installed
Before Memcached installed, I use
mysqldump -u root -p --lock-tables --add-locks --disable-keys --skip-extended-insert --quick wcraze > /var/backup/backup.sql
But now, Memcached has been installed.
According to Wikipedia;
When the table is full, subsequent inserts cause older data to be purged in least recently used (LRU) order.
This means new data entry is not directly saved in MySQL, but saved in Memcached instead, until limit_maxbytes
is full, the least accessed data will be saved in MySQL.
This means, some data is not in the MySQL but in Memcached. So, when backup, the new entry is not in the backup data
What is the right way to backup?
Memcached does not persist data to disk. Your application should be using Memcached as a cache and not for any sort of persistence. All data should be in MySQL and so your backup procedure shouldn't be any different. If there is important data stored in Memcached but not MySQL then this is a serious design flaw of your application.
General overview of Memcached from MySQL: http://dev.mysql.com/doc/refman/5.1/en/ha-memcached.html