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.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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

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