Jump to content

Помогите с MYSQL


Recommended Posts

Всем привет, можете помочь с подключением к MYSQL? Оно подключается по сокету, но мне надо как-то поменять на подключение по порту. Вот код:

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()

Edited by SmileFire
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...