开发同学说在测试环境使用mysqldump导出数据的时候遇到以下错误:

# mysqldump -uroot -p  --all-databases --routines --events --triggers --no-data > /tmp/test.sql;
Enter password:
mysqldump: Got error: 1449: The user specified as a definer ('xxx'@'%') does not exist when using LOCK TABLES

 

查看数据库中的用户,的确不存在:

select user,host from mysql.user;

  

因为库中的数据是从别的地方导入的。导入后就删除了上面的用户'xxx'@'%'。但是库中有一部分views是通过该用户创建的。

现在需要找出这些视图,并修改他们的定义者信息:

select concat("alter definer=`root`@`%` view ", table_name, " as ", view_definition, ";")
from information_schema.views
where table_schema='<你的数据库名>';

  

执行上面查询出语句,到你的数据库中执行即可!

mysqldump: Got error: 1449: The user specified as a definer ('xxx'@'%') does not exist when using LOCK TABLES的更多相关文章

  1. mysqldump: Got error: 1449: The user specified as a definer ('user'@'%') does not exist when using LOCK TABLES

    报错:一个库用mysqldump -u -p --opt --force -e --max_allowed_packet= --net_buffer_length= --databases备份时报错如 ...

  2. Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TAB

    在linux下,用mysql的导出语句: mysqldump -hlocalhost -uroot -pPasswd table >/home/ftp/test.sql 出现了 mysqldum ...

  3. Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: Got error: 1449: The user specified as a definer ('fk_system'@'localhost') does not exist when using LOCK TABLES

    在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...

  4. 1449 - The user specified as a definer('xxx'@'%') does not exist

    指定的用户不存在,创建相应的账户即可,注意主机那里填的内容,我的这个是@'%'所以不用填任何内容.

  5. 错误代码: 1449 The user specified as a definer ('root'@'%') does not exist

    1. 错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:call analyse_use('20150501','20150601 ...

  6. [Err] 1449 - The user specified as a definer ('student'@'%') does not exist

    1.错误描述 [SQL]use student; 受影响的行: 0 时间: 0.001s [SQL] call alter_student('t_student','MODIFY COLUMN `we ...

  7. 1449 - The user specified as a definer ('test'@'%') does not exist

    最近在做一个项目,由于服务器切换,所以需要将原有服务器的mysql数据表以及存储过程导入到另一个服务器的mysql数据库中.导入完成之后以为一切是那么的简单,却没有想到总还是出现了一些莫名其妙的问题. ...

  8. [Err] 1449 - The user specified as a definer ('rybhe'@'%') does not exist

    转载: 最近在做一个项目,由于服务器切换,所以需要将原有服务器的mysql数据表以及存储过程导入到另一个服务器的mysql数据库中.导入完成之后以为一切是那么的简单,却没有想到总还是出现了一些莫名其妙 ...

  9. MySQL 导出数据库,出现 “mysqldump: Got error: 1146”

    出现场景 在 cmd 导出数据库时: mysqldump -hlocalhost -uroot -p student_db > C:\student_db.sql 出现: mysqldump: ...

随机推荐

  1. MySQL Replication--半同步复制(Semi-Sync Replication)

    半同步复制 默认配置下,MYSQL主从库通过binlog来保持一致,主库事务提交后,将binlog日志写入磁盘,然后返回给用户,备库通过拉取主库的binlog来同步主库的操作,无法保证主备节点数据实时 ...

  2. SQL Text Literals 文本

    Text Literals 文本 Use the text literal notation to specify values whenever string appears in the synt ...

  3. python自动化测试框架

    一.环境准备 1.python开发环境, python3.7 2.setuptools基础工具包 3.pip安装包管理工具 4.selenium自动化测试工具  chrom驱动下载地址: http:/ ...

  4. springboot整合mybatis及封装curd操作-配置文件

    1 配置文件  application.properties  #server server.port=8090 server.address=127.0.0.1 server.session.tim ...

  5. YES, There is No such thing as a free lunch

    软件行业本身就建立在copy的基础上的,据说视窗both Windows and Mac OS都借鉴了施乐的. 国内的很多的软件质量真的好差呀. https://queue.acm.org/detai ...

  6. *P3694 邦邦的大合唱站队[dp]

    题目描述 N个偶像排成一列,他们来自M个不同的乐队.每个团队至少有一个偶像. 现在要求重新安排队列,使来自同一乐队的偶像连续的站在一起.重新安排的办法是,让若干偶像出列(剩下的偶像不动),然后让出列的 ...

  7. monkey内存泄露

    monkey内存泄露 1.内存泄露发现方法 执行monkey测试时有时会有内存泄露情况,可以进行排查 a.手机弹出out of  memory对话框--基本确定有内存泄露 b.手机没有提示但是实际有内 ...

  8. 项目Alpha冲刺--9/10

    项目Alpha冲刺--9/10 作业要求 这个作业属于哪个课程 软件工程1916-W(福州大学) 这个作业要求在哪里 项目Alpha冲刺 团队名称 基于云的胜利冲锋队 项目名称 云评:高校学生成绩综合 ...

  9. 35 Top Open Source Companies

    https://www.datamation.com/open-source/35-top-open-source-companies-1.html If you think of open sour ...

  10. c#语言学习笔记(1)

    环境:VS Express 2013 for Desktop 也可以vs社区版,不过学习的话,Express本版做一些小的上位机工具应该是够用了 学习的网站:https://www.runoob.co ...