SmileFire Posted August 25, 2019 Share Posted August 25, 2019 (edited) Всем привет, можете помочь с подключением к 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 August 25, 2019 by SmileFire Link to comment
Space_Unicorn Posted August 28, 2019 Share Posted August 28, 2019 dbConnect( "mysql", "dbname=frank;host=1.2.3.4;port=123456;charset=utf8", "username", "password", "share=1" ) 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