Help - Search - Members - Calendar
Full Version: Plesk db user cannot connect to mysql from tomcat
The Planet Forums > Control Panels > Plesk
pagnolia
Hello

I added a db user with Plesk (7 reloaded) to a newly created database 'mvnforum'. PhpMyAdmin works fine. But when I try to connect to the database using the jsp script below:




Test the database

<%@ page language="java" import="java.sql.*" %>


Connecting to database


<%
Class.forName("org.gjt.mm.mysql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost.localdomain/mvnforum","mvnforum","forumtest");

%>




I get the error:
org.apache.jasper.JasperException: Invalid authorization specification: Access denied for user: 'mvnforum@localhost.localdomain' (Using password: YES)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
...


When I try to connect with the admin user (i.e. Plesk admin) using the same script, the connection is established. I doublechecked the password, it is correct.

Also, the privileges in mysql for the plesk user seem to be ok:
mysql> show grants for 'mvnforum'@'localhost.localdomain';
+----------------------------------------------------------------------------+
| Grants for mvnforum@localhost.localdomain |
+----------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON `mvnforum`.* TO 'mvnforum'@'localhost.localdomain' |
+----------------------------------------------------------------------------+


I'm running a dedicated Pentium 4 Red Hat Enterprise

Any suggestions?
AngAnt
Hi,

I'm having the same permissions' problem, What should I do to use TomCat and MySQL togeter? icon_sad.gif



I hope in you.

Thank's,
Antonio.
pagnolia
In the end it was a permission problem. I had to delete and recreate the relevant users with according permissions.

I cannot tell you, what exactly I did, since I can't remember exactly.
AngAnt
QUOTE
Originally posted by pagnolia
In the end it was a permission problem. I had to delete and recreate the relevant users with according permissions.

I cannot tell you, what exactly I did, since I can't remember exactly.


Thank's for your answer icon_smile.gif

When you created the users, granted all privileges?

I'm searching an answer since 2 weeks ago. icon_sad.gif

Bye,
Antonio.:
Timb0h
have you granted to host * for this user?

tomcat tries to connect using localhost.localdomain (or other way around) whereas most of the apps just use localhost
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.