03.08.2013, 10:52
Here is MySQL Database
I have a file mysql.cfg which contains:
HOST=localhost
DB=sampgta
USER=root
PASS=
SERVER=1
So i compiled my script and everything is fine. I used XAMPP and Navicat premium and i get this error.
[11:14:26] This server folder has been put together by Leighton Allan.
[11:14:26] onfoot_rate = 40 (int, read-only)
[11:14:26] incar_rate = 40 (int, read-only)
[11:14:26] weapon_rate = 40 (int, read-only)
[11:14:26] [MySQL] (Main Pipelines) Connecting to 127.0.0.1...
[11:14:26] [MySQL] (MainPipeline) received! Can not connect to MySQL: Host 127.0.0.1 - DB: sampgta - User: samp125
[11:14:26] [MySQL] Note: Be sure you enter the provided information correctly to connect.
[11:14:26] [LoadBusiness] Loading data from database...
[11:14:26] [RepairPoint] Loading repair points from database...
[11:14:26] [LoadTurfWars] 40 turfs loaded.
[11:14:26] [LoadPaintballArenas] 10 arenas loaded.
[11:14:26] [LoadEventPoints] 0 event points loaded.
[11:14:26] [LoadGates] 4000 gates loaded.
[11:14:26] [LoadElevatorStuff] 20 floors loaded.
[11:14:27] [LoadFamilies] 16 families loaded.
[11:14:27] [LoadPoints] 9 points loaded.
[11:14:27] [LoadCDealerships] 15 dealerships loaded.
[11:14:27] [MiscLoad] Misc Loaded
[11:14:38] Number of vehicle models: 123
[11:14:38] --- Server Shutting Down.
[11:14:38]
I'm guessing it's somewhere along here in the script:
// Custom Functions
// g_mysql_Init()
// Description: Called with Gamemode Init.
stock g_mysql_Init()
{
new SQL_HOST[64], SQL_DB[64], SQL_USER[32], SQL_PASS[128], iValue;
new SQL_SHOST[64], SQL_SDB[64], SQL_SUSER[32], SQL_SPASS[128];
new fileString[128], File: fileHandle = fopen("mysql.cfg", io_read);
while(fread(fileHandle, fileString, sizeof(fileString))) {
if(ini_GetValue(fileString, "HOST", SQL_HOST, sizeof(SQL_HOST))) continue;
if(ini_GetValue(fileString, "DB", SQL_DB, sizeof(SQL_DB))) continue;
if(ini_GetValue(fileString, "USER", SQL_USER, sizeof(SQL_USER))) continue;
if(ini_GetValue(fileString, "PASS", SQL_PASS, sizeof(SQL_PASS))) continue;
if(ini_GetValue(fileString, "SHOST", SQL_SHOST, sizeof(SQL_SHOST))) continue;
if(ini_GetValue(fileString, "SDB", SQL_SDB, sizeof(SQL_SDB))) continue;
if(ini_GetValue(fileString, "SUSER", SQL_SUSER, sizeof(SQL_SUSER))) continue;
if(ini_GetValue(fileString, "SPASS", SQL_SPASS, sizeof(SQL_SPASS))) continue;
if(ini_GetInt(fileString, "SERVER", servernumber)) continue;
if(ini_GetInt(fileString, "DEBUG", iValue)) continue;
}
fclose(fileHandle);
mysql_debug(iValue);
MainPipeline = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
setproperty(.name = "pipeline", .value = MainPipeline);
printf("[MySQL] (Main Pipelines) Connecting to %s...", SQL_HOST);
if(mysql_ping(MainPipeline) == -1)
{
printf("[MySQL] (MainPipeline) received! Can not connect to MySQL Host %s - DB: %s - User: %s", SQL_HOST, SQL_DB, SQL_USER);
print("[MySQL]Note: Be sure you provide the information correctly to connect..");
SendRconCommand("exit");
}
else
{
print("[MySQL] (MainPipeline) Connection successful toward MySQL Database Server!");
}
#if defined SHOPAUTOMATED
ShopPipeline = mysql_connect(SQL_SHOST, SQL_SUSER, SQL_SDB, SQL_SPASS);
printf("[MySQL] (Shop Pipelines) Connecting to %s...", SQL_SHOST);
if(mysql_ping(ShopPipeline) == -1)
{
printf("[MySQL] (ShopPipeline) received! Can not connect to MySQL: Host %s - DB: %s - User: %s", SQL_SHOST, SQL_SDB, SQL_SUSER);
print("[MySQL] Note: Be sure you provide the information correctly to connect.
//SendRconCommand("exit");
}
else
{
print("[MySQL] (ShopPipeline) You successfully connected to MySQL Database Server!");
}
#endif
return 1;
So what should i do?
I have a file mysql.cfg which contains:
HOST=localhost
DB=sampgta
USER=root
PASS=
SERVER=1
So i compiled my script and everything is fine. I used XAMPP and Navicat premium and i get this error.
[11:14:26] This server folder has been put together by Leighton Allan.
[11:14:26] onfoot_rate = 40 (int, read-only)
[11:14:26] incar_rate = 40 (int, read-only)
[11:14:26] weapon_rate = 40 (int, read-only)
[11:14:26] [MySQL] (Main Pipelines) Connecting to 127.0.0.1...
[11:14:26] [MySQL] (MainPipeline) received! Can not connect to MySQL: Host 127.0.0.1 - DB: sampgta - User: samp125
[11:14:26] [MySQL] Note: Be sure you enter the provided information correctly to connect.
[11:14:26] [LoadBusiness] Loading data from database...
[11:14:26] [RepairPoint] Loading repair points from database...
[11:14:26] [LoadTurfWars] 40 turfs loaded.
[11:14:26] [LoadPaintballArenas] 10 arenas loaded.
[11:14:26] [LoadEventPoints] 0 event points loaded.
[11:14:26] [LoadGates] 4000 gates loaded.
[11:14:26] [LoadElevatorStuff] 20 floors loaded.
[11:14:27] [LoadFamilies] 16 families loaded.
[11:14:27] [LoadPoints] 9 points loaded.
[11:14:27] [LoadCDealerships] 15 dealerships loaded.
[11:14:27] [MiscLoad] Misc Loaded
[11:14:38] Number of vehicle models: 123
[11:14:38] --- Server Shutting Down.
[11:14:38]
I'm guessing it's somewhere along here in the script:
// Custom Functions
// g_mysql_Init()
// Description: Called with Gamemode Init.
stock g_mysql_Init()
{
new SQL_HOST[64], SQL_DB[64], SQL_USER[32], SQL_PASS[128], iValue;
new SQL_SHOST[64], SQL_SDB[64], SQL_SUSER[32], SQL_SPASS[128];
new fileString[128], File: fileHandle = fopen("mysql.cfg", io_read);
while(fread(fileHandle, fileString, sizeof(fileString))) {
if(ini_GetValue(fileString, "HOST", SQL_HOST, sizeof(SQL_HOST))) continue;
if(ini_GetValue(fileString, "DB", SQL_DB, sizeof(SQL_DB))) continue;
if(ini_GetValue(fileString, "USER", SQL_USER, sizeof(SQL_USER))) continue;
if(ini_GetValue(fileString, "PASS", SQL_PASS, sizeof(SQL_PASS))) continue;
if(ini_GetValue(fileString, "SHOST", SQL_SHOST, sizeof(SQL_SHOST))) continue;
if(ini_GetValue(fileString, "SDB", SQL_SDB, sizeof(SQL_SDB))) continue;
if(ini_GetValue(fileString, "SUSER", SQL_SUSER, sizeof(SQL_SUSER))) continue;
if(ini_GetValue(fileString, "SPASS", SQL_SPASS, sizeof(SQL_SPASS))) continue;
if(ini_GetInt(fileString, "SERVER", servernumber)) continue;
if(ini_GetInt(fileString, "DEBUG", iValue)) continue;
}
fclose(fileHandle);
mysql_debug(iValue);
MainPipeline = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
setproperty(.name = "pipeline", .value = MainPipeline);
printf("[MySQL] (Main Pipelines) Connecting to %s...", SQL_HOST);
if(mysql_ping(MainPipeline) == -1)
{
printf("[MySQL] (MainPipeline) received! Can not connect to MySQL Host %s - DB: %s - User: %s", SQL_HOST, SQL_DB, SQL_USER);
print("[MySQL]Note: Be sure you provide the information correctly to connect..");
SendRconCommand("exit");
}
else
{
print("[MySQL] (MainPipeline) Connection successful toward MySQL Database Server!");
}
#if defined SHOPAUTOMATED
ShopPipeline = mysql_connect(SQL_SHOST, SQL_SUSER, SQL_SDB, SQL_SPASS);
printf("[MySQL] (Shop Pipelines) Connecting to %s...", SQL_SHOST);
if(mysql_ping(ShopPipeline) == -1)
{
printf("[MySQL] (ShopPipeline) received! Can not connect to MySQL: Host %s - DB: %s - User: %s", SQL_SHOST, SQL_SDB, SQL_SUSER);
print("[MySQL] Note: Be sure you provide the information correctly to connect.
//SendRconCommand("exit");
}
else
{
print("[MySQL] (ShopPipeline) You successfully connected to MySQL Database Server!");
}
#endif
return 1;
So what should i do?