Killer... Posted March 7, 2015 Share Posted March 7, 2015 Hello Everyone, i need your help. Im doing an MTA Fairplay server and...when i uplodaded it to the VPS, it tell's my this error. [2015-03-07 11:21:30] ERROR: roleplay-accounts/s_accounts.lua:174: dbConnect failed; Can't connect to local MySQL server through socket '' (111) [2015-03-07 11:21:30] Error: MySQL connection is not established! [2015-03-07 11:21:30] ERROR: roleplay-accounts/s_webserver.lua:85: dbConnect failed; Can't connect to local MySQL server through socket '' (111) [2015-03-07 11:21:30] Error: MySQL web_connection is not established! And i went to the script of s_accounts.lua:174 and s_webserver.lua:85, but there's no space por put the socket or something. Please help. Link to comment
Addlibs Posted March 7, 2015 Share Posted March 7, 2015 Try adding ;unix_socket=/var/run/mysqld/mysqld.sock (including the ; at the front) to the end of the 2nd parameter string (host) eg: test_db = dbConnect( "mysql", "dbname=frank;host=1.2.3.4;unix_socket=/var/run/mysqld/mysqld.sock", "username", "password", "share=1" ) Link to comment
Killer... Posted March 7, 2015 Author Share Posted March 7, 2015 function testSQLConnection() if (connection) then local query = dbQuery(connection, "SELECT `??` FROM `??` WHERE `??` = '??' LIMIT 1", "value", "config", "key", "motd") if (query) then local result, num_affected_rows, errmsg = dbPoll(query, -1) if (num_affected_rows > 0) and (type(result) == "table") then for result,row in pairs(result) do if (row["value"]) then outputServerLog("Notice: Connection is working!") g_motd = row["value"] end end else outputServerLog("Error: MySQL query failed.") end else outputServerLog("Error: MySQL query failed.") end else outputServerLog("Error: Could not test the query connection due to no stable MySQL connection.") outputServerLog("... attempting a repair ...") test_db = dbConnect( "mysql", "dbname=tlvrp;host=localhost;unix_socket=/var/lib/mysql/mysql.sock", "tlvrp", "gabriel32", "share=1" ) if (not connection) then outputServerLog("... repair failed!") else outputServerLog("... repair successful!") end end end The error is the same Link to comment
Addlibs Posted March 7, 2015 Share Posted March 7, 2015 line 22, change 'test_db' to 'connection' Link to comment
Killer... Posted March 7, 2015 Author Share Posted March 7, 2015 The problem is the same. Link to comment
Addlibs Posted March 7, 2015 Share Posted March 7, 2015 absolutely nothing changed in the debug message? Link to comment
Killer... Posted March 7, 2015 Author Share Posted March 7, 2015 Nope same problem. [12:05:53] ERROR: roleplay-accounts/s_accounts.lua:175: dbConnect failed; Can't connect to local MySQL server through socket '' (111) Link to comment
Addlibs Posted March 7, 2015 Share Posted March 7, 2015 Is line 175 on line 22 in the code snippet you've sent, or is it another dbConnect statement? Link to comment
Killer... Posted March 7, 2015 Author Share Posted March 7, 2015 absolutely nothing changed in the debug message? Thanks man, i put it on the addEventHandler("onResourceStart", resourceRoot, function() aclReload() connection = dbConnect( "mysql", "dbname=tlvrp;host=localhost;unix_socket=/var/lib/mysql/mysql.sock", "tlvrp", "gabriel32", "share=1" ) if (not connection) then outputServerLog("Error: MySQL connection is not established!") else outputServerLog("Notice: MySQL connection is established!") testSQLConnection() end setTimer(function() reconnectSQL() end, 60000*5, 0) for i,v in ipairs(getElementsByType("player")) do if (isClientInTutorial(v)) then local x, y, z = tonumber(getElementData(v, "roleplay:temp.x")), tonumber(getElementData(v, "roleplay:temp.y")), tonumber(getElementData(v, "roleplay:temp.z")) setElementPosition(v, x, y, z) setElementInterior(v, 0) setElementDimension(v, 0) setCameraTarget(v, v) setElementRotation(v, 0, 0, 90) setElementFrozen(v, false) setElementData(v, "roleplay:accounts.state", 2, true) removeElementData(v, "roleplay:temp.md5rofl") removeElementData(v, "roleplay:temp.x") removeElementData(v, "roleplay:temp.y") removeElementData(v, "roleplay:temp.z") setElementData(v, "roleplay:accounts.option3", 1, false) dbExec(connection, "UPDATE `??` SET `??` = '??' WHERE `??` = '??'", "accounts", "option_3", 1, "id", getAccountID(v)) toggleAllControls(v, true, true, true) end end end ) Because after i used the test mysql. Thanks Men Link to comment
Dio85 Posted June 22, 2015 Share Posted June 22, 2015 http://kepfeltoltes.hu/view/150622/mta- ... es.hu_.png i have just this problem, and the faction work just i restart the resource(and just for me) and some panel not work. any idea? i use 1.4 and 1.5 . and noting error in the log. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now