Cadell Posted June 2, 2014 Share Posted June 2, 2014 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
pa3ck Posted June 2, 2014 Share Posted June 2, 2014 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
Cadell Posted June 2, 2014 Author Share Posted June 2, 2014 I tried that it give me error wait ill post mysql connection script I am using with error Link to comment
..:D&G:.. Posted June 2, 2014 Share Posted June 2, 2014 Wrong section mate, you might want to have a look here: https://forum.multitheftauto.com/viewforum.php?f=106 Link to comment
Cadell Posted June 3, 2014 Author Share Posted June 3, 2014 server is insatled and working problem is i cant able to conect my server to other server my sql can you make me script for connection only i want to use mysql present on this host : 108.170.10.163 Link to comment
pa3ck Posted June 3, 2014 Share Posted June 3, 2014 test_db = dbConnect( "mysql", "dbname=frank;host=1.2.3.4", "username", "password", "share=1" ) Fill in your own details: "dbname" database name, "host" IP address, "username" and "password". Link to comment
tosfera Posted June 3, 2014 Share Posted June 3, 2014 Thing I did, I used wine to run the windows version on Ubuntu, using the ( OUTDATED ) mysql plugin ( dll files ). Link to comment
Mr_Moose Posted June 3, 2014 Share Posted June 3, 2014 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
Cadell Posted June 5, 2014 Author Share Posted June 5, 2014 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
Mr_Moose Posted June 5, 2014 Share Posted June 5, 2014 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
pa3ck Posted June 5, 2014 Share Posted June 5, 2014 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
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