On Wed, Feb 27, 2013 at 12:41:13PM -0800, Thomas Sibley wrote: > On 02/27/2013 09:14 AM, John Buell wrote: > > Hm, thanks for pointing that out Kevin. I had been using: Mysqldump > > --opt --add-drop-table --single-transaction -u rt_user -pPassword -h > > localhost rt4 > rt4-mysql-backup-`date %Y%m%d` > > > > I see the sense in doing the backup on the page that you linked to, > > but when I do it that way, I'm getting 'error 1044: Access denied for > > user 'rt_user'@'localhost' to database 'rt4' when doing LOCK TABLES. > > > > So is there something else I'm missing, or might someone have just > > been active in a session? > > The database user RT creates (rt_user by default) isn't granted the > ability to issue LOCK TABLE commands. Backups should be made by a full > privileged database user, such as "root" by default on MySQL. If you > must use the database user which RT uses, you will need to grant it more > rights.
As Tom notes, we usually run backups as a more privileged user, but if you want to run as the rt_user because that password is already store on disk somewhere, you can insert --single-transaction or --skip-lock-tables in the first part of that command - the mysqldump rt4 --tables sessions --no-data; because even though you're only asking for a schema, MySQL locks. I filed http://issues.bestpractical.com/Ticket/Display.html?id=22893 so someone will look at that doc and update. -kevin
pgpGF6Mo6Iet1.pgp
Description: PGP signature
-- RT training in Amsterdam, March 20-21: http://bestpractical.com/services/training.html Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T
