教程集 www.jiaochengji.com
教程集 >  数据库  >  mysql  >  正文 mysqldump: Got error: 1449: The user specifie

mysqldump: Got error: 1449: The user specifie

发布时间:2017-03-10   编辑:jiaochengji.com
教程集为您提供mysqldump: Got error: 1449: The user specifie等资源,欢迎您收藏本站,我们将为您提供最新的mysqldump: Got error: 1449: The user specifie资源
在使用mysql备份工具时发现提示mysqldump: Got error: 1449: The user specifie错误了,这个是什么原因导致的呢我们一起来看看它的解决办法吧,具体的操作细节如下所示。

使用mysqldump命令备份数据库时出现以下了错误。

执行命令

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy4504')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy4504>

# mysqldump --add-drop-table --events --quote-names -uroot -p -hlocalhost yunwei | \
gzip  >/tmp/mysql_yunwei_`date %Y%m%d`.gz

</td></tr></table>

提示错误

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy7034')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy7034>

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

</td></tr></table>

原因

迁移数据库时删除了yunuser用户,或者导入时用其他用户操作的。

解决方法

使用single-transaction选项在导出时,对表不进行Lock(简单粗暴的方式)。

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy9638')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy9638># mysqldump --single-transaction -uroot -p -hlocalhost yunwei | \
gzip  >/tmp/mysql_yunwei_`date %Y%m%d`.gz
</td></tr></table>

还有其他方法就是,添加该用户、修改定义View的SQL等。

您可能感兴趣的文章:
mysqldump: Got error: 1449: The user specifie
mysqldump 导出发生Lost connection to MySQL server during query
mysqldump备份命令的常用操作与意外终止的解决方法
使用mysqldump备份与还原mysql数据的实例及参数说明
mysqldump : Error: Binlogging on server not active的解决方法
聊聊golang的zap的Sink
Mysqldump和Source命令用法详解
定期自动备份mysql的shell脚本(实例分享)
jQuery 开发者应该注意的9个错误
一个好用的php mysql连接类

[关闭]
~ ~