Jump to content

My SQL Crashing The Server


JR10

Recommended Posts

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.

Link to comment

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.

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