Jump to content

[mysql connection problem]


Cadell

Recommended Posts

hi guys i need some help in mysql connetion on ubunto i downloaded linux module from wiki also added in mtaserver.config my problem is i want to attach my server with other server where mysql db is working. so any 1 can help me plz

Link to comment

You don't need any module as MySQL is built into MTA. If you want to use an external MySQL connection, just use the IP address instead of localhost. It works the same way, there's no difference. You never asked a question though, where did you get stuck?

Link to comment

So the reason is to keep two (or more) servers synced? Well there is a simple solution for that as well, running them from the same directory, all you need is two different config files and a bat file that move these files during startup of the servers to prevent collisions. A pretty simple and effective solution that seems to work. Your bat file might look like this:

:: Initialize multiple MTA servers 
echo "Server starter" 
echo "Initialize server 1..." 
  
:: Copies the config file for server 1 and wait 3 seconds 
copy "C:\mta-servers\config1\mtaserver.conf" "C:\mta-servers\mods\deathmatch\" /Y 
ping -n 4 127.0.0.1 > nul 
  
:: Start server 1 
C:\mta-servers\mta-server1.exe 
  

Simply add that ping to localhost at the end and copy the code to load the next server, everything get's synced by default. Just note that I've only been testing this solution for a few hours, there may be issues in it but haven't found anything so far. It does it job and keeps multiple servers synced.

Link to comment

i tried that script i got this error :-

Could not load /home/fear/mta/mods/deathmatch/./dbconmy.so - l

ibmysqlclient.so.15: cannot open shared object file: No such file or directory[0

5:20:46] ERROR: mysql/mysql.lua:5: dbConnect failed; Could not connect

Link to comment

That was just a way to use SQLite instead of MySQL but just forget it, after some tests of that method it turned out that SQLite fails when multiple instances tries to write to the file at the same time, an issue that get's noticed when players starts to join both the servers, the sync wasn't very good either so go ahead and use MySQL

Link to comment
i tried that script i got this error :-

Could not load /home/fear/mta/mods/deathmatch/./dbconmy.so - l

ibmysqlclient.so.15: cannot open shared object file: No such file or directory[0

5:20:46] ERROR: mysql/mysql.lua:5: dbConnect failed; Could not connect

This issue doesn't belong to the scripting section, I think the thread will be moved to the right section. Anyways, what OS are you using? Ubuntu / Debian / Cent OS?

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