yugecin / tsstats

Bot for teamspeak3 to collect data for generating statistics
GNU General Public License v3.0
8 stars 4 forks source link

Cant start the bot #10

Closed enzops closed 2 years ago

enzops commented 7 years ago

Hi, i have a problem when i launch the jar file.

[29/8 16:11:50] er Could not connect to MySQL server
-- -- Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
 0 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 2 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 3 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
 4 at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
 5 at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1137)
 6 at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:355)
 7 at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2490)
 8 at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2527)
 9 at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2309)
10 at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
11 at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
12 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
13 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
14 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
16 at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
17 at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:419)
18 at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
19 at java.sql.DriverManager.getConnection(DriverManager.java:571)
20 at java.sql.DriverManager.getConnection(DriverManager.java:215)
21 at database.Database.connect(Database.java:35)
22 at database.Database.createStatement(Database.java:64)
23 at stats.Stats.loadServerTOD(Stats.java:73)
24 at stats.Stats.<init>(Stats.java:43)
25 at core.Connection.<init>(Connection.java:60)
26 at main.Main.main(Main.java:41)
[29/8 16:11:50] er System will halt

I correctly edited the file tsstats.ini ...

yugecin commented 7 years ago

Is the database server running? Is the dbhost correct? Is there any firewall that could be blocking database communications? If you are using localhost as database host, try using 127.0.0.1

enzops commented 7 years ago

The database is on an other server, the firewall does not block anything. I have to host the site and the database on the same server as that of the teamspeak?

yugecin commented 7 years ago

Should work fine with remote servers. Can you confirm that your database server accepts remote connections?