Hero192 Posted February 7, 2016 Share Posted February 7, 2016 Hello, I have a problem I'm trying to start a server, The server will require MySQL and my host is on GNU/Linux. I start scripting with using dbFunction to open the connection to the database but it return with an error I don't know what I had done wrong. Here's the code in below local mysql = {"localhost", "database2A", "root", "root", 3306} local host, database, user, pass, port = unpack(mysql) local connection = dbConnect( "mysql", "host=" .. host .. ";port=" .. port .. ";dbname=" .. database, user, pass, "share=1", "autoreconnect=1" ) if connection then outputDebugString("MySQL Database has been connected succesfully.") else outputDebugString("MySQL Database return false.") end dbExec (connection, "CREATE TABLE IF NOT EXISTS account (User TEXT") WARNING:Line 10: Bad argument @ 'dbExec' [Expected db-connection at argument 1, got boolean] also the table won't be created, please help me Thanks in advance Link to comment
MTA Team ccw Posted February 7, 2016 MTA Team Share Posted February 7, 2016 Check the server log to find out why dbConnect is failing Link to comment
Hero192 Posted February 7, 2016 Author Share Posted February 7, 2016 Here's the last action: and I don't know how to deal with it dbConnect failed; Can't connect to local MySQL server through socket "(111) Link to comment
Hero192 Posted February 7, 2016 Author Share Posted February 7, 2016 Can I just know what I have missed on ? Link to comment
MTA Team ccw Posted February 7, 2016 MTA Team Share Posted February 7, 2016 Use 127.0.0.1 instead of localhost Link to comment
Hero192 Posted February 7, 2016 Author Share Posted February 7, 2016 I have a question, what's the difference if the server is running on GNU/Linux and with Windows 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