nasserdfdd Posted April 23, 2015 Share Posted April 23, 2015 hi all this is my first post so i wish i get helped i have sql script but i get this error error sql\sql.lua:5: dbconnect failed; can't connect to mysql server on 'localhost' (10061) this is the line 5 db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";localhost=127.0.0.1"..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); btw my server is right now localhost and not online only local cuz iam making it i wish i remove this error as fast as possible Link to comment
TrapLord Studios™ Posted April 23, 2015 Share Posted April 23, 2015 Just put either `localhost` or `127.0.0.1` Link to comment
nasserdfdd Posted April 23, 2015 Author Share Posted April 23, 2015 i have changed it to this db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host=127.0.0.1"..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); and now it is showing me this error sql/sql.lua:5: dbConnect failed; unknown mysql host '127.0.0.1localhost' Link to comment
TrapLord Studios™ Posted April 23, 2015 Share Posted April 23, 2015 Try this: db = dbConnect( "mysql", "dbname=".. tostring(get("DATABASE_NAME"))";host=127.0.0.1", port="".. tostring(get("MYSQL_PORT"))"",unix_socket="/opt/lampp/var/mysql/mysql.sock", "".. tostring(get("MYSQL_USER"))"", "".. tostring(get("MYSQL_PASS")) .." ", "share=1;autoreconnect=1" ) Link to comment
nasserdfdd Posted April 23, 2015 Author Share Posted April 23, 2015 hi i have another error db = dbConnect( "mysql", "dbname=".. tostring(get("DATABASE_NAME"))";host=127.0.0.1", port="".. tostring(get("MYSQL_PORT"))"",unix_socket="/opt/lampp/var/mysql/mysql.sock", "".. tostring(get("MYSQL_USER"))"", "".. tostring(get("MYSQL_PASS")) .." ", "share=1;autoreconnect=1" ) the error is sql\sql.lua:5: '>' expected near '=' second is sql\sql.lua:5: '>' expected near '=' Link to comment
TrapLord Studios™ Posted April 23, 2015 Share Posted April 23, 2015 Try now: db = dbConnect( "mysql", "dbname=".. tostring(get("DATABASE_NAME"))";host=127.0.0.1", port="".. tostring(get("MYSQL_PORT"))"";unix_socket=/opt/lampp/var/mysql/mysql.sock, "".. tostring(get("MYSQL_USER"))"", "".. tostring(get("MYSQL_PASS")) .." ", "share=1;autoreconnect=1" ) Link to comment
nasserdfdd Posted April 23, 2015 Author Share Posted April 23, 2015 the old error came cant connect to mysql server on '127.0.0.1' (10061) and sorry that i disturbed u Link to comment
Dimos7 Posted April 23, 2015 Share Posted April 23, 2015 db = dbConnect("msql", "dbname=" ..tostring(get("DATABASE_NAME"))"127.0.0.1", "port =" .. tostring(get("MYSQL_PORT"))""; unix_socket=/opt/lampp/var/mysql/mysql.sock, ..tostring(get("MSQL_USER"))"", ..tostring(get("MYSQL_PASS")).." "," share=1;autoreconnect=1") Link to comment
nasserdfdd Posted April 23, 2015 Author Share Posted April 23, 2015 db = dbConnect("msql", "dbname=" ..tostring(get("DATABASE_NAME"))"127.0.0.1", "port =" .. tostring(get("MYSQL_PORT"))""; unix_socket=/opt/lampp/var/mysql/mysql.sock, ..tostring(get("MSQL_USER"))"", ..tostring(get("MYSQL_PASS")).." "," share=1;autoreconnect=1") they give me this error sql\sql.lua:5: '>' expected near ';' 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