You are hereBlogs / David Grant's blog / Backing up MySQL Databases With AutoMySQLBackup

Backing up MySQL Databases With AutoMySQLBackup


By David Grant - Posted on 11 September 2006

I just discovered a very useful bash script tonight, AutoMySQLBackup. It is a nice and easy way to backup your mysql databases daily, weekly, and monthly. It was very easy to set up and works great. A great suggestion to prevent having to put the username and password for a database user with read/write access in the script is to do the following:

mysql -u root -p -e "GRANT SELECT, LOCK TABLES ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'backupPW';"

That creates a database called backup with password backupPW with only SELECT and LOCK TABLES access to the database. This tip came from this gentoo-wiki.com article on MySQL backup.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <s> <img>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Insert Google Map macro.
  • Images can be added to this post.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may use [view:name=display=args] tags to display views.

More information about formatting options

CAPTCHA
Sorry I had to add this test to combat the spam problem.