0

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

Harry Pham
  • 98
  • 1
  • 11
  • can you send the domain.xml ? – silviud Jan 02 '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 03 '11 at 04: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 03 '11 at 05:59

1 Answers1

0

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.

Sacx
  • 2,581
  • 16
  • 13