Jump to content

My SQL Crashing The Server


JR10

Recommended Posts

Posted

Here is what happens:

I downloaded ml_mysql.dll

I run the server a window appears saying libmysql.dll is missing.

Downloaded it, and when I run the server says unable to find libmysql.dll, but ml_mysql runs this time successfully.

Next I made a test script whenever I use mysqlOpen My server crashes.

Even used the exact same example on wiki, but changed the username and pass.

function onMySQLOpen ( result ) 
    if ( result ) then 
        outputServerLog ( "MySQL connection established." ) 
    else 
        outputServerLog ( "MySQL connection failed." ) 
    end 
end 
  
db = mysqlCreate () 
mysqlOpen ( db, "onMySQLOpen", "localhost", "test", "test", "jr10test", 3306 ) 
  

First time I use mysql.

Windows 7.

EDIT: there is not problems with the arguments, I used xamp, made a full Privileges user name: test password: test.

I made a database with the name jr10test.

EDIT: i found libmysql.dll in mabako mta paradise, just took it.

Posted

Done, but now it doesn't find it, and give me the message that it's missing.

EDIT: I just checked MTA - Paradise, there it's not added to mtaserver.conf as a module.

And if I do that, it says it's missing.

  • MTA Team
Posted

Indeed. I just added it to modules in the mtaserver.config, it says it fails to run, but the server runs smoothly. If you dont' add libmysql to it, it will abort the server.

Posted

Now I know where to put it, MTA Directory\server\libmysql.dll

handler = mysql_connect("localhost", "test", "test", "jr10test") -- Establish the connection 
if ( not handler ) then -- The connection failed 
  outputDebugString("Unable to connect to the MySQL server") 
else 
local result = mysql_query(handler, "CREATE TABLE IF NOT EXISTS Test (TEST NUMBER,NAME TEXT)") 
if (not result) then 
  outputDebugString("Error executing the query: (" .. mysql_errno(handler) .. ") " .. mysql_error(handler)) 
else 
  mysql_free_result(result) -- Freeing the result is IMPORTANT 
  result = mysql_query(handler, "SELECT * FROM Test") 
end 
end 

I tried this, and it gives me syntax error.

Posted (edited)

Jacob have problems for the first time :D

Reinstall a server or MTA and that's it , just store somewhere config, modules and resources ( if needed )

Edited by Guest
Posted
Reinstall a server or MTA and that's it , just store somewhere config, modules and resources ( if needed )

That's is not the problem, the server doesn't crash any more.

The example I posted just don't work.

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