MySql Connection Confusion, Basic Questions
MySql Connection Confusion, Basic Questions
Can't seem to connect to my remote mysql db. Here's my config:
<Driver>com.mysql.jdbc.Driver</Driver>
<ConnectionString>jdbc:mysql://94.74.31.145/mytest</ConnectionString>
<UserName>blahblah</UserName>
<Password>xxxxxx</Password>
I get a "Can't load db driver error... [SEVERE] DBmanger could not retrieve a connection..."
I'm unclear on just a couple of points. Sorry if these are very basic questions. Do I need to download and install a mysql driver? Isn't that what the <Driver> connection tag above is for? I'm running on windows vista. Which folder would I put the mysql driver into if I need to download one? My database is on another server. Do you know if my connection string is in the correct format? The IP address I've put in is simply what phpmyadmin says at the top is the Server address for my db. Do I need to add a port # like :3306 or anything else? The name of my db is mytest, but apparently it's not getting past the driver part.
Any feedback much appreciated.
<Driver>com.mysql.jdbc.Driver</Driver>
<ConnectionString>jdbc:mysql://94.74.31.145/mytest</ConnectionString>
<UserName>blahblah</UserName>
<Password>xxxxxx</Password>
I get a "Can't load db driver error... [SEVERE] DBmanger could not retrieve a connection..."
I'm unclear on just a couple of points. Sorry if these are very basic questions. Do I need to download and install a mysql driver? Isn't that what the <Driver> connection tag above is for? I'm running on windows vista. Which folder would I put the mysql driver into if I need to download one? My database is on another server. Do you know if my connection string is in the correct format? The IP address I've put in is simply what phpmyadmin says at the top is the Server address for my db. Do I need to add a port # like :3306 or anything else? The name of my db is mytest, but apparently it's not getting past the driver part.
Any feedback much appreciated.
Sorry Lapo but I cannot get this working even though I have allowed remote access on my db server. I have searched here for similar posts and this is the closest one, but there is no answer there:
viewtopic.php?t=4293&highlight=load++driver
Here is my config:
<DatabaseManager active="true">
<Driver>org.gjt.mm.mysql.Driver</Driver> <ConnectionString>jdbc:mysql://97.74.31.9:3306/testdb</ConnectionString> <UserName>blahblah</UserName> <Password>xxxxxx</Password>
<TestSQL><![CDATA[SELECT COUNT(*) FROM table1]]></TestSQL>
I keep getting this error:
DB Manager Activated <org. gjt.mm.mysql.Driver>
Can't load db driver: org.gjt.mm.mysql.Driver
[SEVERE] > DBManager could not retrieve a connection. java.sql.SQLException: Configuration file not found
Any ideas? Thank you.
viewtopic.php?t=4293&highlight=load++driver
Here is my config:
<DatabaseManager active="true">
<Driver>org.gjt.mm.mysql.Driver</Driver> <ConnectionString>jdbc:mysql://97.74.31.9:3306/testdb</ConnectionString> <UserName>blahblah</UserName> <Password>xxxxxx</Password>
<TestSQL><![CDATA[SELECT COUNT(*) FROM table1]]></TestSQL>
I keep getting this error:
DB Manager Activated <org. gjt.mm.mysql.Driver>
Can't load db driver: org.gjt.mm.mysql.Driver
[SEVERE] > DBManager could not retrieve a connection. java.sql.SQLException: Configuration file not found
Any ideas? Thank you.
It seems your mysql driver is not seen in the classpath. Have you followed the instructions found here?
http://www.smartfoxserver.com/docs/docP ... ection.htm
You should simply copy the .jar file to {sfs-install-dir}/jre/lib/ext folder
http://www.smartfoxserver.com/docs/docP ... ection.htm
You should simply copy the .jar file to {sfs-install-dir}/jre/lib/ext folder
I'm having similar problems. Both SFS and mysql are on the same computer. I copied the latest JDBC for mysql, as per the instructions, and it still doesn't work. SFS even says it's processing that jar file!
But then goes on to say that it can't load the driver!
Here's a copy/paste of what im getting on server start:
http://dukecg.net/ohmy.txt
Code: Select all
*sys-package-mgr*: processing new jar, 'C:\Program Files\SmartFoxServerPRO_1.6.2
\jre\lib\ext\mysql-connector-java-3.1.14-bin.jar'
But then goes on to say that it can't load the driver!
Code: Select all
Can't load db driver: org.gjt.mm.mysql
Here's a copy/paste of what im getting on server start:
http://dukecg.net/ohmy.txt
Hey duke,
You may need to change the Driver in your config.xml to your current driver.
You may want to check out this post for some hints.
http://www.smartfoxserver.com/forums/viewtopic.php?p=15260#15260
Hope it helps,
- Mike
You may need to change the Driver in your config.xml to your current driver.
You may want to check out this post for some hints.
http://www.smartfoxserver.com/forums/viewtopic.php?p=15260#15260
Hope it helps,
- Mike
orthiac wrote:Hey duke,
You may need to change the Driver in your config.xml to your current driver.
You may want to check out this post for some hints.
http://www.smartfoxserver.com/forums/viewtopic.php?p=15260#15260
Hope it helps,
- Mike
Thank you sir - that worked! I was still using the old driver name.
- Ross Przybylski
- Posts: 70
- Joined: 24 Jan 2008, 03:56
- Contact:
I'm having some trouble connecting to my MySQL forums database that's hosted remotely via Godaddy.com. Here's the error I'm getting:
--- [ Zones & Rooms ] -------------------------------------
DB Manager Activated ( org.gjt.mm.mysql.Driver )
16:07:23.860 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.
jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statem
ent failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer
.java:1843)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigRead
er.java:806)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:174)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Problems in config file: The Test SQL statement failed! Please check your config
uration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL st
atement failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:199)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Errors found in configuration files.
Unable to start the server.
I've got mysql-connector-java-5.1.7-bin.jar copied to my SmartFoxServerPRO_1.6.6\jre\lib\ext folder. Here's what my database configuration looks like:
Thanks in advance for the help!
--- [ Zones & Rooms ] -------------------------------------
DB Manager Activated ( org.gjt.mm.mysql.Driver )
16:07:23.860 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.
jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statem
ent failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer
.java:1843)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigRead
er.java:806)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:174)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Problems in config file: The Test SQL statement failed! Please check your config
uration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL st
atement failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:199)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Errors found in configuration files.
Unable to start the server.
I've got mysql-connector-java-5.1.7-bin.jar copied to my SmartFoxServerPRO_1.6.6\jre\lib\ext folder. Here's what my database configuration looks like:
Code: Select all
<DatabaseManager active="true">
<Driver>org.gjt.mm.mysql.Driver</Driver>
<ConnectionString>jdbc:mysql://her0913310164613.db.4054273.hostedresource.com</ConnectionString>
<UserName>********</UserName>
<Password>********</Password>
<TestSQL><![CDATA[SELECT COUNT(*) FROM smf_members]]></TestSQL>
<MaxActive>10</MaxActive>
<MaxIdle>10</MaxIdle>
<OnExhaustedPool>fail</OnExhaustedPool>
<BlockTime>5000</BlockTime>
</DatabaseManager>
Thanks in advance for the help!
- Ross Przybylski
- Posts: 70
- Joined: 24 Jan 2008, 03:56
- Contact:
Thanks orthiac. I tried your suggestion, but got similar results (see below). Any other ideas?
Code: Select all
--- [ Zones & Rooms ] -------------------------------------
DB Manager Activated ( com.mysql.jdbc.Driver )
21:03:15.091 - [ SEVERE ] > DbManager could not retrive a connection. com.mysql.
jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
it.gotoandplay.smartfoxserver.exceptions.DbManagerException: The Test SQL statem
ent failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.SmartFoxServer.setupZone(SmartFoxServer
.java:1843)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.parse_Zones(ConfigRead
er.java:806)
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:174)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Problems in config file: The Test SQL statement failed! Please check your config
uration.
it.gotoandplay.smartfoxserver.exceptions.ConfigurationException: The Test SQL st
atement failed! Please check your configuration.
at it.gotoandplay.smartfoxserver.lib.ConfigReader.readZoneConfig(ConfigR
eader.java:199)
at it.gotoandplay.smartfoxserver.SmartFoxServer.initServerSocket(SmartFo
xServer.java:339)
at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
607)
Errors found in configuration files.
Unable to start the server.
Shutting down server...
Sometime we're lucky, sometimes we work.
Not sure. It may take some additional information to find the answer.
Are you running the SFServer remotely or locally to your hosting account?
- You may need additional settings on your hosted site to access it remotely.
Can you connect to it (the same way) using some other method?
= SQL Developer is a free application to help work with db's.
Have you checked with GoDaddy or Google?
= GoDaddy Help Center Google
- Mike
Not sure. It may take some additional information to find the answer.
Are you running the SFServer remotely or locally to your hosting account?
- You may need additional settings on your hosted site to access it remotely.
Can you connect to it (the same way) using some other method?
= SQL Developer is a free application to help work with db's.
Have you checked with GoDaddy or Google?
= GoDaddy Help Center Google
- Mike
Instead of using the server name here:
try using the IP address of your MySQL server.
Also make sure that your MySQL server is configured to accept client connections from the outside world. By default MySQL listens only on 127.0.0.1 (localhost)
Code: Select all
<ConnectionString>jdbc:mysql://her0913310164613.db.4054273.hostedresource.com</ConnectionString>
try using the IP address of your MySQL server.
Also make sure that your MySQL server is configured to accept client connections from the outside world. By default MySQL listens only on 127.0.0.1 (localhost)
- Ross Przybylski
- Posts: 70
- Joined: 24 Jan 2008, 03:56
- Contact:
Thanks everyone for your help. As it turns out, it was indeed the remote connectivity of the MySQL server that was causing issue. For all future forum readers, if you use Godaddy hosting for your MySQL databases, you need to ensure the "remote" option is enabled at the time you create the database because remote databases are stored on a different server than their local ones. If you need to change this setting at a later time, you will need to backup the old database, create a new database with remote on, and then restore the new database with the old one's backup file.
So- now that I've got database connection working, I have a new problem! I'm trying to insert a new record into a DB table and the server is jbdc driver is rejecting the command because certain values don't have default values- namingly, values with text datatypes that are set to non-null. (FYI- The database I am trying to add values to was created by my Simple Machines Forum). The strange thing is, I can use phpAdmin and the same SQL command that didn't work with the jbdc driver in SFS works fine in phpMyAdmin. All of the cells with text datatypes simply show as being empty (just like when the forum adds records). Does anyone know why the jbdc behavior would be different? Any recommended solutions?
So- now that I've got database connection working, I have a new problem! I'm trying to insert a new record into a DB table and the server is jbdc driver is rejecting the command because certain values don't have default values- namingly, values with text datatypes that are set to non-null. (FYI- The database I am trying to add values to was created by my Simple Machines Forum). The strange thing is, I can use phpAdmin and the same SQL command that didn't work with the jbdc driver in SFS works fine in phpMyAdmin. All of the cells with text datatypes simply show as being empty (just like when the forum adds records). Does anyone know why the jbdc behavior would be different? Any recommended solutions?
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 31 guests