- 34
- 3
Проблема с подключение сервера на mysql. Настроил mysql_settings.ini , всё равно выдаёт ошибку с подключением
Ошибку которую выдаёт
Код:
host=ипхоста мой
username=gs275407
database=gs275407
password=мой пароль
Ошибку которую выдаёт
Код:
[14:18:24] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2002 'Can't connect to MySQL server on '127.0.0.1' (10061)'
сервер:
#include <a_samp>
#include <fix>
#include <a_mysql>
#include <dc_cmd>
#include <sscanf2>
#include <foreach>
#include <Pawn.Regex>
#define MYSQL_HOST "127.0.0.1"
#define MYSQL_USER "gs275407"
#define MYSQL_BASE "gs275407"
#define MYSQL_PASS ""
main()
{
print("\n----------------------------------");
print(" new project dm");
print("----------------------------------\n");
}
new MySQL:dbHandle;
enum player
{
ID,
NAME[MAX_PLAYER_NAME],
PASSRORD[24],
}
new player_info[MAX_PLAYERS][player];
enum dialogs
{
DLG_NONE,
DLG_REG,
DLG_LOG,
}
public OnGameModeInit()
{
ConnectMySQL(); // Ïîäêëþ÷åíèå MySQL
return 1;
}
stock ConnectMySQL()
{
dbHandle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_BASE , MYSQL_PASS);
switch(mysql_errno()) // MySQL
{
case 0: print("база данный подключена");
default: print("база данных не подключена");
}
mysql_log(ERROR | WARNING);
mysql_set_charset("cp1251");
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}