Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On my Ubuntu VPS, i have a mysql server running and a Glassfish 3.0.1 Application Server running. And I am having a hard to have my GF successfully ping the database. Here is my GF set up

Assume: x.y.z.t is the ip of my VPS

Resource Type: javax.sql.ConnectionPoolDataSource
User: root
DatabaseName: scholar
Url: jdbc:mysql://x.y.z.t:3306/scholar
URL: jdbc:mysql://x.y.z.t:3306/scholar
Password: xxxx
PortNumber: 3306
ServerName: x.y.z.t

Inside my glassfish3/glassfish/lib, I have my mysql-connector-java-5.1.13-bin.jar

Inside the database, table mysql here is the result of the query

select User, Host from user;
+------------------+-----------+
| User             | Host      |
+------------------+-----------+
| root             | 127.0.0.1 | 
| debian-sys-maint | localhost | 
| root             | localhost | 
| root             | yunaeyes  | 
+------------------+-----------+

Now from my machine, if I try to connect to this db via mysql browser (mysql client software), well I cant. Well from the table above, seem like it only allow localhost to connect to this db. Keep in mind that both my db and my GF are on the same VPS. Please help

share|improve this question
    
can you send the domain.xml ? –  silviud Jan 2 '11 at 14:00
    
I kind of figure it out. Since both my database, and my GF are on the same VPS, I change Url: jdbc:mysql://x.y.z.t:3306/scholar to Url: jdbc:mysql://localhost:3306/scholar, and it worked. Plus from what the user table show above, it look like, the db only allow access from localhost anyway. Do you know how to make it so that I can access it remotely? –  Harry Pham Jan 3 '11 at 4:15
1  
Grant privileges to 'user'@'*' or to the specific domains that they will be connecting from, i.e. 'user'@'x.y.z.t'. –  Andrew M. Jan 3 '11 at 5:59
    
thank you very much –  Harry Pham Jan 3 '11 at 6:19

1 Answer 1

Your database is binding on 127.0.0.1. just change, in my.cnf, bind-interface to: x.y.z.t and it will work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.