=KoG=Rouche Posted December 1, 2015 Share Posted December 1, 2015 (edited) Hi all, I'm back into Scripting. I have a new problem with my dbconnect function. Here is my code : server.lua ---- MYSQL Connection ---- -- Create an connection object for the Database function connectDB() local con = dbConnect("mysql","dbname=MYDBNAME;host=127.0.0.1", "DBUSER", "DBPASS", "share=1") if (con) then outputDebugString("Connection OK !") else outputDebugString("Connection to Database failled !") end return con end ------- VARIABLES ------- rootElement = getRootElement() local connect = connectDB() When i try this it says : ERROR : line4 : dbConnect failed. Could not connect Do you see any error ? Thanks for helping. Edited December 2, 2015 by Guest Link to comment
Captain Cody Posted December 1, 2015 Share Posted December 1, 2015 Assuming the way you copied it moved line 3 to line 4, do you have the right ip and stuff? Link to comment
Anubhav Posted December 1, 2015 Share Posted December 1, 2015 Check the MySQL port, maybe its different from normal one. then in dbConnect add it like this port=yourMySQLPort Link to comment
=KoG=Rouche Posted December 1, 2015 Author Share Posted December 1, 2015 (Copy and Paste make more line than normal) Modules are loaded in mtaserv.conf and result of netstat is : tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN I tried with : local con = dbConnect("mysql","dbname=MYDBNAME;host=127.0.0.1;port=3306", "DBUSER", "DBPASS", "share=1") Link to comment
jingzhi Posted December 2, 2015 Share Posted December 2, 2015 (Copy and Paste make more line than normal)Modules are loaded in mtaserv.conf and result of netstat is : tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN I tried with : local con = dbConnect("mysql","dbname=MYDBNAME;host=127.0.0.1;port=3306", "DBUSER", "DBPASS", "share=1") Make sure the group of your db user is set to "host" Link to comment
=KoG=Rouche Posted December 2, 2015 Author Share Posted December 2, 2015 Found the problem. I use Debian 64bits. [2015-12-02 19:42:42] MODULE: Unable to load mods/deathmatch/modules/mta_mysql.so (libmysqlclient.so.15: wrong ELF class: ELFCLASS64) [2015-12-02 19:42:42] MODULE: Loaded "Sockets Module" (1.30) by "Gamesnert, MCvarial & x86" Does someone have the file for 64 ? libmysqlclient.so.15 Link to comment
iPrestege Posted December 2, 2015 Share Posted December 2, 2015 Hi this one is the file you need : https://nightly.multitheftauto.com/files/libmysqlclient.so.15 . Link to comment
=KoG=Rouche Posted December 2, 2015 Author Share Posted December 2, 2015 I add to : dpkg -i --arch-structure i386 apt-get install ia32-libs (need to add a old depository in /etc/apt/source.list) Then add your file in usr/lib32 Thank you. 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