mysql 备份导出 ('root'@'%') does not exist
来源:互联网 发布:思途旅游cms源码 编辑:程序博客网 时间:2024/06/07 07:59
The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES
用MySQL的导出语句或备份时的异常
在Linux下:
mysqldump -hlocalhost
在Windows下:
mysqldump -hlocalhost
出现了如下问题:
mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES
分析后发现,是因为存储过程的创建是seattle用户定义者,而现在备份的是用root用户。
还有数据库在使用状态,所以导出数据时报错,不是存储过程定义者就需要锁表
--lock-all-tables,-x
在开始导出之前,提交请求锁定所有数据库中的所有表,以保证数据的一致性。
mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES这是一个全局读锁,并且自动关闭 --single-transaction 和 --lock-tables 选项。
在mysqldump时使用 -x 选项解决此问题。解决方案有两种:
第一种:直接加参数
mysqldump -hlocalhost -uroot -proot -x databasename> e:/myfile/seattle.sql
再执行导出就OK
----------------------------------------------------------------------------------------------------------------
第二种:赋予当前导出者seattle所有的权限
只要给seattle用户再添加一个对全部host都有可以访问的权限
操作如下:
登陆mysql
mysql -u root -proot
mysql >grant all privileges on *.* to seattle@"%"identified by "123";
mysql >flush privileges;
在cmd执行导出就OK
----------------------------------------------------------------------------------------------------------------
以上问题可以得出,创建存储过程如果默认参数在备份时有局限性。
- mysql 备份导出 ('root'@'%') does not exist
- MySQL ('root'@'%') does not exist的问题
- MySQL ('root'@'%') does not exist的问题
- MySQL ('root'@'%') does not exist 的问题
- MySQL ('root'@'%') does not exist的问题
- MySQL ('root'@'%') does not exist的问题
- definer('root'@'%') does not exist
- a definer ('root'@'%') does not exist
- Specified web-root folder does not exist
- 如何处理definer('root'@'%') does not exist?
- MYSQL FUNCTION mysql.redis_servers_set_v2 does not exist
- mySql问题:The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- MySQL The user specified as a definer ('root'@'%') does not exist。
- mysql出现The user specified as a definer ('root'@'%') does not exist报错!
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- python opencv人脸检测提取及保存
- 网络编程:Socket编程
- iOS开发之制作framework
- git study notes
- Qt 一个点击事件和改变按钮文字的demo
- mysql 备份导出 ('root'@'%') does not exist
- uva 488 Triangle Wave
- android修改textview中某段字体的属性
- MATLAB学习笔记之-----floor函数 与 ceil函数
- NSPredicate的使用
- 前端面试问题
- 黑马程序员 十五、内省:JavaBean、 Beanutils、注解、泛型
- 7 天打造前端性能监控系统
- 主成分分析(PCA)原理详解