Hey everyone,
since updating to r34 i got the following error on server start: Код:
[16:36:35] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) |
echo Executing Server Config... lanmode 0 rcon_password sefgsdfgdfghsder5tesr5y5ersy5er6yt maxplayers 25 port 7777 hostname SA-MP 0.3 Server gamemode0 Max filterscripts plugins mysql streamer sscanf whirlpool nativechecker announce 1 query 1
[23:49:48] Server Plugins [23:49:48] -------------- [23:49:48] Loading plugin: mysql [23:49:48] Failed. [23:49:48] Loading plugin: streamer [23:49:48] *** Streamer Plugin v2.6.1 by Incognito loaded *** [23:49:48] Loaded.
Hosting a server on a remote server, and MySQL is failing to start.
It works perfectly on my home computer and I've uploaded all necessarry files. Is there something that needs to be installed on the server to get it running? The server is Windows. Код:
[...] Код:
[23:49:48] Server Plugins [23:49:48] -------------- [23:49:48] Loading plugin: mysql [23:49:48] Failed. [23:49:48] Loading plugin: streamer [23:49:48] *** Streamer Plugin v2.6.1 by Incognito loaded *** [23:49:48] Loaded. |
Yes, there is: http://www.solidfiles.com/d/dcb62ce7e5/
|
[ERROR] CMySQLHandle::ConnectT - (error #2003) Can't connect to MySQL server on 'SERVERIP' (10061)
MySQL = mysql_connect(HOSTNAME, USERNAME, DATABASE, PASSWORD, PORT, BOOL:AUTORECONNECT);
MySQL = mysql_connect("localhost", "DvL", "Samp", "toohardforyou", 3306, true);
[23:49:48] Loading plugin: mysql [23:49:48] Failed. ... [23:49:49] Script[gamemodes/gamemode.amx]: Run time error 19: "File or function is not found"
[15:24:54] [ERROR] CMySQLQuery::Execute[SendQuery()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
new ali[350];
format(ali, 350, "CREATE TABLE IF NOT EXISTS `%s` \
(`tPX` float(20) NOT NULL,\
`tPY` float(20) NOT NULL,\
`tText` varchar(500) NOT NULL,\
`tLSX` float(20) NOT NULL,\
`tLSY` float(20) NOT NULL,\
`tTSX` float(20) NOT NULL,\
`tTSY` float(20) NOT NULL,\
`tAlign` int(20) NOT NULL,\
`tColor` int(25) NOT NULL,\
`tUB` int(10) NOT NULL,\
`tBC` int(25) NOT NULL,\
`tShadow` int(20) NOT NULL,\
`tOL` int(25) NOT NULL,\
`tBGC` int(25) NOT NULL,\
`tFont` int(10) NOT NULL,",inputtext);
strcat(ali, "`tProportional` int(20) NOT NULL,\
`tSelectable` int(10) NOT NULL,\
`tPM` int(20) NOT NULL,\
`tPRX` float(20) NOT NULL,\
`tPRY` float(20) NOT NULL,\
`tPRZ` float(20) NOT NULL,\
`tPRZoom` float(20) NOT NULL,\
`tPVC1` int(10) NOT NULL,\
`tPVC2` int(10) NOT NULL,\
`Tyype` int(5) NOT NULL)\
ENGINE=MyISAM;",350);
mysql_tquery(handle, ali, "SendQuery", "");
OS: Windows 7 64bit MySQL Server version: 5.6.12 Plugin version: R34
define TABLE_NAME "Your_Table_Here"
public OnGameModeInit()
{
new ali[ 255 char ], handle;
format(ali, sizeof(ali), "CREATE TABLE IF NOT EXISTS `%s` \
(`tPX` float(20) NOT NULL,\
`tPY` float(20) NOT NULL,\
`tText` varchar(500) NOT NULL,\
`tLSX` float(20) NOT NULL,\
`tLSY` float(20) NOT NULL,\
`tTSX` float(20) NOT NULL,\
`tTSY` float(20) NOT NULL,\
`tAlign` int(20) NOT NULL,\
`tColor` int(25) NOT NULL,\
`tUB` int(10) NOT NULL,\
`tBC` int(25) NOT NULL,\
`tShadow` int(20) NOT NULL,\
`tOL` int(25) NOT NULL,\
`tBGC` int(25) NOT NULL,\
`tFont` int(10) NOT NULL,");
format(ali, sizeof(ali), "`tProportional` int(20) NOT NULL,\
`tSelectable` int(10) NOT NULL,\
`tPM` int(20) NOT NULL,\
`tPRX` float(20) NOT NULL,\
`tPRY` float(20) NOT NULL,\
`tPRZ` float(20) NOT NULL,\
`tPRZoom` float(20) NOT NULL,\
`tPVC1` int(10) NOT NULL,\
`tPVC2` int(10) NOT NULL,\
`Tyype` int(5) NOT NULL)\
ENGINE=MyISAM;", TABLE_NAME);
mysql_tquery(handle, ali, "SendQuery", "");
}
new ali[ 255 char ], handle;
/*=======>*/format(ali, sizeof(ali), "CREATE TABLE IF NOT EXISTS `%s` \
(`tPX` float(20) NOT NULL,\
`tPY` float(20) NOT NULL,\
`tText` varchar(500) NOT NULL,\
`tLSX` float(20) NOT NULL,\
`tLSY` float(20) NOT NULL,\
`tTSX` float(20) NOT NULL,\
`tTSY` float(20) NOT NULL,\
`tAlign` int(20) NOT NULL,\
`tColor` int(25) NOT NULL,\
`tUB` int(10) NOT NULL,\
`tBC` int(25) NOT NULL,\
`tShadow` int(20) NOT NULL,\
`tOL` int(25) NOT NULL,\
`tBGC` int(25) NOT NULL,\
`tFont` int(10) NOT NULL,");
/*=======>*/format(ali, sizeof(ali), "`tProportional` int(20) NOT NULL,\
`tSelectable` int(10) NOT NULL,\
`tPM` int(20) NOT NULL,\
`tPRX` float(20) NOT NULL,\
`tPRY` float(20) NOT NULL,\
`tPRZ` float(20) NOT NULL,\
`tPRZoom` float(20) NOT NULL,\
`tPVC1` int(10) NOT NULL,\
`tPVC2` int(10) NOT NULL,\
`Tyype` int(5) NOT NULL)\
ENGINE=MyISAM;", TABLE_NAME);
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3x, ©2005-2013 SA-MP Team [19:59:24] [19:59:24] Server Plugins [19:59:24] -------------- [19:59:24] Loading plugin: mysql [19:59:24] Failed. [19:59:24] Loading plugin: streamer [19:59:24] *** Streamer Plugin v2.6.1 by Incognito loaded *** [19:59:24] Loaded. [19:59:24] Loading plugin: sscanf [19:59:24] [19:59:24] =============================== [19:59:24] sscanf plugin loaded. [19:59:24] Version: 2.8.1 [19:59:24] © 2012 Alex "Y_Less" Cole [19:59:24] =============================== [19:59:24] Loaded. [19:59:24] Loading plugin: nativechecker [19:59:24] Loaded. [19:59:24] Loading plugin: Whirlpool [19:59:24] [19:59:24] ================== [19:59:24] [19:59:24] Whirlpool loaded [19:59:24] [19:59:24] ================== [19:59:24] [19:59:24] Loaded. [19:59:24] Loaded 4 plugins. [19:59:24] [19:59:24] Filterscripts [19:59:24] --------------- [19:59:24] Loaded 0 filterscripts. [19:59:24] Error: Function not registered: 'cache_get_row_count' [19:59:24] Error: Function not registered: 'mysql_close' [19:59:24] Error: Function not registered: 'mysql_connect' [19:59:24] Error: Function not registered: 'mysql_tquery' [19:59:24] Error: Function not registered: 'cache_get_data' [19:59:24] Error: Function not registered: 'cache_get_row_int' [19:59:24] Error: Function not registered: 'cache_get_row' [19:59:24] Error: Function not registered: 'cache_get_row_float' [19:59:24] Error: Function not registered: 'cache_insert_id' [19:59:24] Error: Function not registered: 'WP_Hash' [19:59:24] Error: Function not registered: 'mysql_escape_string' [19:59:24] Script[gamemodes/MyRP.amx]: Run time error 19: "File or function is not found" [19:59:24] Number of vehicle models: 0
Hey. im using the mysql plugin R33 (https://sampforum.blast.hk/showthread.php?tid=56564 ),
It works on my other pc, but on this one it doesn't work. Код:
[...] [19:59:24] Loading plugin: mysql [19:59:24] Failed. [...] I don't know what i am doing wrong. Ive also re-installed .net framework, but that didn't help too any one knows what the problem is? |
//Make an enum for all player data
enum PlayerData
{
ORM:ORM_ID,
ID,
Username[24],
Password[129],
Admin
};
new playerData[MAX_PLAYERS][PlayerData];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Player_Name[playerid][Username], MAX_PLAYER_NAME);
new ORM:ormid = playerData[playerid][ORM_ID] = orm_create("players");
orm_addvar_int(ormid, playerData[playerid][ID], "id");
orm_addvar_string(ormid, playerData[playerid][Username], MAX_PLAYER_NAME, "name");
orm_addvar_string(ormid, playerData[playerid][Password], 128, "pass");
// ... password etc.
orm_addvar_int(ormid, playerData[playerid][Admin], "admin");
//Set Key to Username so we can search the database for that user and load all info as above
orm_setkey(ormid, "Username");
//Selects all data from database where Username = players name and then calls OnPlayerDataLoad
orm_select(ormid, "OnPlayerDataLoad", "d", playerid);
// more..
return 1;
}
forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
switch(orm_errno(pData[playerid][ORM_ID]))
{
case ERROR_OK:
{
//LOGIN PLAYER STUFF
}
case ERROR_NO_DATA:
{
//User was not found in database, make them register
}
}
//Change the key to ID for future updating of mysql
orm_setkey(pData[playerid][ORM_ID], "ID");
return 1;
}
Player_Name[playerid][0] is correct, did you tried it like that? You can use orm_addvar_* with every variable you like.
Also passing char-typed variables per reference is unsupported in PAWN (or maybe it is? someone should ask ****** about that one). |