Jump to content

MySQL in GNU/Linux


Hero192

Recommended Posts

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

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...