Mysql problem
#1

Hey guys, I got a problem with a script. It needs to be connected to the mysql database, which i have hosted with XAMPP and i have edited the part in script
#define SERVER_HOST "127.0.0.1"
#define SERVER_DB "server"
#define SERVER_USER "root"
#define SERVER_PASSWORD ""

Thought when i launch the server, it wont load the gamemode. I can connect to the server, but it just says "Connecting to the server... Retrying..." And in the SAMP client, under the gamemode it says Unknown.

Any help ?
Reply
#2

Have you edited your MySQL Database yet?
You must create a database named "server" in your SQL server and edit it.
If not, the worst thing might happen -- the server crashes.
Reply
#3

Yes, i started my PhpMyAdmin with XAMPP, created a new database called "server", imported all the tables in there and edited script as stated above.
Reply
#4

If you still get the problem, check if "SERVER_USER" and "SERVER_PASSWORD" settings are right.
And please show us your "OnGameModeInit" code.
Reply
#5

You mean this ?
public OnGameModeInit() {
CreateServerTextDraws();
ConnectServer();
for(new i = 0; i < MAX_VEHICLES; i ++ ) {
strmid(CarData[i][Owner], "None", 0, strlen("None"), 255);
CarData[i][Engine] = false;
LightsToggled[i] = false;
CarData[i][Rented] = false;
}
Reply
#6

Yes.
But this time I wonder to know what is in "ConnectServer()".
Reply
#7

function ConnectServer() {
print(" Connecting to the database please wait.");
mysql_connect(SERVER_HOST, SERVER_USER, SERVER_DB, SERVER_PASSWORD);
mysql_debug(1);
if(mysql_ping() == -1) {
print(" You're not connected!");
}
else {
print(" You're connected!");
}
SMFConnection = mysql_connect(SMF_HOST, SMF_USER, SMF_DB, SMF_PASSWORD);
if(mysql_ping(SMFConnection) != 1) {
print("Unable to connect");
}
else {
print("Connected to the CSMF");
}
}


Oh and I'll post my server log too, just incase:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3a R8, ©2005-2010 SA-MP Team

[10:35:26] filterscripts = "" (string)
[10:35:26]
[10:35:26] Server Plugins
[10:35:26] --------------
[10:35:26] Loading plugin: streamer.dll
[10:35:26]

*** Streamer Plugin v2.3.8 by Incognito loaded ***

[10:35:26] Loaded.
[10:35:26] Loading plugin: sscanf.dll
[10:35:26]

[10:35:26] ===============================

[10:35:26] sscanf plugin loaded.

[10:35:26] © 2009 Alex "******" Cole

[10:35:26] ===============================

[10:35:26] Loaded.
[10:35:26] Loading plugin: mysql.dll
[10:35:26]

> MySQL plugin R6-2 successfully loaded.

[10:35:26] Loaded.
[10:35:26] Loaded 3 plugins.

[10:35:26]
[10:35:26] Filter Scripts
[10:35:26] ---------------
[10:35:26] Loaded 0 filter scripts.

[10:35:26] Number of vehicle models: 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)