---
title: "mysql 无lock tables权限 报Access denied for user when using LOCK TABLES"
author: "MNTMs"
date: "2015-06-15T18:19:07Z"
tags: []
categories: ["编程语言"]
slug: "mysql-lock-tables-access-denied-for-user-when-using-lock-tables"
draft: false
lastmod: "2015-06-15T18:19:06Z"
id: 2219826
url: "https://mntms.iteye.com/blog/2219826"
---

普通用户备份mysql [数据库](http://www.2cto.com/database/)报错  
[mysql](http://www.2cto.com/database/MySQL/) 无lock tables权限 报Access denied for user 'dbuser'@'localhost' to database 'db' when using LOCK TABLES  
主要原因是该用户无lock tables 该权限，处理办法：  
1\. 给该普通用户赋予lock tables 权限，建议是删除该用户，重新用mysql命令建  
2\. 加上--skip-lock-tables即可  
mysqldump -udbuser -p dbname --skip-lock-tables &gt; dbname.sql  
3\. 使用root 备份