mysql 权限问题 Permission denied: connect

Servlet.service() for servlet [mvc-dispatcher] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLNonTransientConnectionException: Could not connect to localhost:3308 : Permission denied: connect] with root cause
java.net.SocketException: Permission denied: connect
重装的服务器系统,重新部署的一个tomcat ,里面有3,4个项目,和特定的请求没关系,因为相同请求大部分时候是好的,隔一段时间就会报这个错误。除非重启mysql服务才恢复正常。

你看看当前用户在当前路径下有没有写的权限

  1. 数据连接数是多少,你配置了么?
  2. 你是使用什么连接数据的,设置相关的闲时超时时间没?
  3. 是不是请求的数量超过tomcat容器设置的连接数?

看起来像是缺少部分权限导致的,你可以试试下列的文章的方法设置权限后再看看
http://blog.csdn.net/wengyupeng/article/details/3290415