Jump to content

MySQL connection problem with (dbConnect)


Recommended Posts

Hi, every time i try to connect to localhost, it occurs this error:

dbConnect failed; Can't connect to MySQL server on 'localhost' (10061)

And here is the connection code:

dbConnect("mysql", "dbname=test;host=localhost") 

and i wonder what (10061) is in the error above ..

Link to comment

You can do what I do:

local dbName = "Database name goes here" 
local host = "website goes here" 
local username = "username goes here" 
local password = "password goes here" 
local dbConnection = dbConnect( "mysql", "dbname="..dbName..";host="..host, username, password) 

Link to comment
There is no need for websites to connect to, as far as i know i can connect to my localhost by just typing 'localhost' or what do you mean by 'website goes here'?

Well my server is hosted so I put in the website but since you're localhost I think you just have to put localhost where host is.

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