Hello everyone, can you help with connecting to MYSQL? It connects on a socket, but I need to change somehow on connection on IP. Here's the code:
local unix_socket, host = unix_socket, host
local dbname, user, password = dbname, user, password
local mainDB
function connect()
local startTick = getTickCount()
mainDB = dbConnect("mysql", (unix_socket and "unix_socket="..unix_socket or "host="..host)..";dbname="..dbname, user, password)
if (mainDB) then
outputDebugString("[MYSQL] Connection: "..getTickCount()-startTick.." ms.")
else
outputDebugString("[MYSQL][ERROR] Connection failed!", 1)
setTimer(connect, 5000, 1)
end
end
connect()