MySQL does not connect.
#1

Hi guys, i wanted to know why my gamemode won't connect to my database... Here's the script 'ConnectToMySQL'...
pawn Код:
stock connectToMysql() {
    if(server_enviroment == ENVIROMENT_DEV) {
        mysql_connect("localhost","serverplurirp","my_serverplurirp","");
        if(mysql_ping() == -1) { print("Unable to connect to MySQL server... Quitting"); SendRconCommand("exit"); } else { print("Connected to MySQL server"); }
        print("Server Enviroment: DEV");
    } else if (server_enviroment == ENVIROMENT_LIVE) {
        mysql_connect("localhost","serverplurirp","my_serverplurirp","");
        if(mysql_ping() == -1) { print("Unable to connect to MySQL server... Quitting"); SendRconCommand("exit"); } else { print("Connected to MySQL server"); }
        print("Server Enviroment: LIVE");
    } else {
        print("Unknown server enviroment, quitting.");
        SendRconCommand("exit");
    }
}
SA-MP Server crashes after trying to connect, it says 'Connecting to MySQL server...' and 'Unable to connect to MySQL server...Quitting' and it crashes... Why? Thanks in advance.
Reply
#2

Load crashdetect if it crashed, run your server again and if it gets crashed again, then show us what it prints in the console/server log.

Although, I do not know what your problem is with the MySQL.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Load crashdetect if it crashed, run your server again and if it gets crashed again, then show us what it prints in the console/server log.

Although, I do not know what your problem is with the MySQL.
The crashdetect does not print anything... So there's the log...
Код:
SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[21:26:17] 
[21:26:18] Server Plugins
[21:26:18] --------------
[21:26:18]  Loading plugin: streamer
[21:26:18] 

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

[21:26:18]   Loaded.
[21:26:18]  Loading plugin: crashdetect
[21:26:18]   CrashDetect v4.11.2 is OK.
[21:26:18]   Loaded.
[21:26:18]  Loading plugin: regex
[21:26:18] 


[21:26:18] ______________________________________


[21:26:18]  Regular Expression Plugin v0.2.1 loaded
[21:26:18] ______________________________________


[21:26:18]  By: Fro © Copyright <TBG> 2009-2011
[21:26:18] ______________________________________


[21:26:18]   Loaded.
[21:26:18]  Loading plugin: audio
[21:26:18] 

*** Audio Plugin v0.5 R2 by Incognito loaded ***

[21:26:18]   Loaded.
[21:26:18]  Loading plugin: Whirlpool
[21:26:18]  
[21:26:18]  ==================
[21:26:18]  
[21:26:18]   Whirlpool loaded
[21:26:18]  
[21:26:18]  ==================
[21:26:18]  
[21:26:18]   Loaded.
[21:26:18]  Loading plugin: mysql
[21:26:18] 

  > MySQL plugin R5 successfully loaded.

[21:26:18]   Loaded.
[21:26:18]  Loaded 6 plugins.

[21:26:19] 
[21:26:19] Ban list
[21:26:19] --------
[21:26:19]  Loaded: samp.ban
[21:26:19] 
[21:26:19] 
[21:26:19] Filterscripts
[21:26:19] ---------------
[21:26:19]   Loading filterscript 'converter.amx'...
[21:26:19] 
--------------------------------------
[21:26:19]  Strcmp To ZCMD Converter
[21:26:19] --------------------------------------

[21:26:19]   Loaded 1 filterscripts.

[21:26:20] Connecting to MySQL server..
[21:26:20] *** Audio Plugin: Started TCP server on port 7777
[21:26:21] Unable to connect to MySQL server... Quitting
[21:26:21] Server Enviroment: DEV
[21:26:21] Text Draws Created.
[21:26:21] Menus Created.
[21:26:21] Running new race
[21:26:21] Job Vehicles Created.
[21:26:21] Job Pickups Created.
[21:26:21] Streamed Objects: 443
[21:26:21] 37 Gates Added
[21:26:21] 6 Speed Cameras Added
[21:26:21] Refreshing Population
[21:26:21] Refreshing Market Prices...
[21:26:21] 
----------------------------------
[21:26:21]  RP Script By TJ (SAMP Forums: TTJJ)
[21:26:21]  This script comes AS IS, I offer NO support or assistance in its operation
[21:26:21]  Please do not remove credits or claim this script was made by yourself
[21:26:21] ----------------------------------

[21:26:21] Number of vehicle models: 9
[21:26:21] --- Server Shutting Down.
[21:26:21] 

*** Streamer Plugin v2.6.1 by Incognito unloaded ***

[21:26:21] 


[21:26:21] ______________________________________


[21:26:21]  Regular Expression Plugin v0.2.1 unloaded
[21:26:21] ______________________________________
Reply
#4

Well, the server was not crashed but it was shuted down by:
pawn Код:
SendRconCommand("exit");
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Well, the server was not crashed but it was shuted down by:
pawn Код:
SendRconCommand("exit");
I know... It send that RCON-command when it isn't connect to my database... (All of my scriptfiles are there)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)