您好,欢迎光临! 推荐您使用Chrome浏览器访问本站。

The user specified as a definer (‘root’@’%’) does not exist

1,291 views
The user specified as a definer (‘root’@’%’) does not exist从其他库导入后,查询无法使用,提示:The user specified as a definer (‘root’@’%’) does not exist,原因为root无访问权限,只要给root用户再添加一个对全部host都有可以访问的权限 操作如下: 登陆mysql mysql -u root -pPasswd mysql >grant all privileges on *.* to root@”%” identified by “Passwd” mysql >flush privileges;

You can’t specify target table

992 views
You can’t specify target table今天在批量删除记录时出现You can’t specify target table ‘threaddet’ for update in FROM clause错误提示。 语句如下: delete from threaddet where id in (SELECT m.id FROM `threaddet` m left outer join `filedmsg` f on (m.filemsgid = f.id) WHERE f.id is null) 后查找网络得到错误原因为: 不能先select出同一表中的某些值,再delete这个表(在同一语句中)。 使用oracle时常常这样写,但mysql是不支持此种用法。后改用网友的子集方式,搞定此问题。 改进后的语句: delete from threaddet where id in ......

Mysql 允许远程连接

938 views
Mysql 允许远程连接mysql出于安全方面考虑默认只允许本机(localhost, 127.0.0.1)连接访问。 那么要在其他主机访问该怎么设置呢? 只需执行如下语句让本机外的其他都可以访问即可: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 当然你也可以参考:http://www.studyday.net/2010/08/64

Lock wait timeout exceeded; try restarting transaction

1,022 views
Lock wait timeout exceeded; try restarting transaction今天运行java出现如下错误: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction 查询网络资料说原因是使用InnoDB   表类型的时候,默认参数:innodb_lock_wait_timeout设置锁等待的时间是50s,因为有的锁等待超过了这个时间,所以抱错。 可以把这个时间加长,或者优化存储过程,事务避免过长时间的等待. my.ini文件: #innodb_lock_wait_timeout = 50 -》 innodb_lock_wait_timeout = 500 重启mysql服务。 更多参考: 1、锁等待超时。是当前事务在等待其它事务释放锁资源造成的。可以找出锁资源竞争的表和......