Jump to content

[OK] MySQL on Debian 6 (64bits) and MTA Lua Script


=KoG=Rouche

Recommended Posts

Hi all,

I'm trying to use MySQL Database for my scripts but ... i got some problems.

I followed the MTA Wiki (https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL).

My server is Running on Debian 64bits, service MySQL, Apache2 and Phpmyadmin has been installed successfully (it works fine).

I added the librairies as asked in MTA Wiki !

I created a folder "modules" in /mta/mods/deathmatch/ and added mta_mysql.so in it.

In the meta i added this line :

Here is the error i get with /debuscript 1 on my server :

d90e.png

In MTA Server Logs i can see this line :

Line 8522: [2013-11-18 23:22:44] MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)! 

So i installed the "libmysqlclient.so.15" ! It doesn't work ...

Can someone help me ?

Here is my code (I think the problem is not from the code) :

-- Default 
host = "127.0.0.1" -- Database Host 
username = "admin" -- Database Username 
password = "adminpassword" -- Database Password 
db = "mta_db" -- Database ( Where you got your tables ) 
  
handler = mysql_connect( host, username, password, db) -- Establish the connection 
if ( not handler ) then -- The connection failed 
  outputDebugString("Unable to connect to the MySQL server") 
else 
  mysql_close(handler) -- Close the connection 
end 

Edited by Guest
Link to comment
You should use the default MTA database functions.

https://wiki.multitheftauto.com/wiki/Se ... _functions

Really the only reason people now use the MySQL module is for vG scripts.

(As far as I know, the MySQL Module only works on a 32-bit operating system.)

As a starter, you should use the default db functions. Why? Cause they are protected against mysql injections and that kind of stuff, if you want to take a step higher and want to take the risk to get injections; use the mysql module. I'd go for the mysql module cause of the less limitations in the queries. But it's alot less safe.

Link to comment
I'd go for the mysql module cause of the less limitations in the queries. But it's alot less safe.

Or then you can make your own wrapper functions on top of default database functions and then extend the abilities of the default functions so that they're close to the module's functions and features.

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