在SmartFoxServer中配置MySQL服务器连接

时间:2013-09-02 06:48:11

标签: mysql jdbc smartfoxserver

我一直在尝试通过config.xml中的JDBC连接到mysql。

我已将默认值更改为正确的值,如下所示:

<DatabaseManager active="true">


        <Driver>org.gjt.mm.mysql.Driver</Driver>
        <ConnectionString>jdbc:mysql://127.0.0.1:3306/mysql</ConnectionString>

        <UserName>root</UserName>
        <Password></Password>

        <TestSQL><![CDATA[SELECT NOW()]]></TestSQL>

        <MaxActive>10</MaxActive>
        <MaxIdle>10</MaxIdle>

        <OnExhaustedPool>fail</OnExhaustedPool>
        <BlockTime>5000</BlockTime>

</DatabaseManager>

但是当我尝试启动SmartFoxServer时,会出现以下错误:

        DB Manager Activated ( org.gjt.mm.mysql.Driver )
Can't load db driver: org.gjt.mm.mysql.Driver
11:13:16.054 - [ SEVERE ] > DbManager could not retrive a connection. java.sql.S
QLException: Configuration file not found
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...

Press any key to continue . . .

请告诉我,我做错了什么?

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

我找到了答案。

应该复制MySQL Connector / J:

C:\ProgramFiles(x86)\MySQL\MySQL Connector J\mysql-connector-java-5.1.26-bin.jar

到:

C:\Users\username\SmartFoxServerPRO_1.6.6\jre\lib\ext\

然后重新启动SFS。

它就像一个魅力。祝你好运。