Jump to content

MySQL Error acces denied


S!LenTzZ

Recommended Posts

mysqlconnect = {user="", connect="", password="", ip=""} 
  
dbConnectTable = { 
    connect = false, 
    user = "xxx", 
    password = "xxx", 
    ip = "roa-multigaming.net", 
    table = "mybb", 
} 
  
  
function onResourceInfoStart() 
    dbConnectTable.connect = dbConnect("mysql","dbname="..dbConnectTable.table..";host="..dbConnectTable.ip, dbConnectTable.user, dbConnectTable.password) 
    if dbConnectTable.connect then 
        checkMySQLTable(dbConnectTable.connect,infoDatabase.tableName,infoDatabase.tableStructure) 
        commandSystemMySQLInit() 
        likeSystemDatabaseInit() 
    end 
end 
addEventHandler("onResourceStart",resourceRoot,onResourceInfoStart) 
  
local DSEC=24*60*60 -- secs in a day 
local YSEC=365*DSEC -- secs in a year 
local LSEC=YSEC+DSEC    -- secs in a leap year 
local FSEC=4*YSEC+DSEC  -- secs in a 4-year interval 
local BASE_DOW=4    -- 1970-01-01 was a Thursday 
local BASE_YEAR=1970    -- 1970 is the base year 
  
  
function gmtime(t) 
    local y,j,m,d,w,h,n,s 
    local mdays=_days 
    s=t 
    -- First calculate the number of four-year-interval, so calculation 
    -- of leap year will be simple. Btw, because 2000 IS a leap year and 
    -- 2100 is out of range, this formula is so simple. 
    y=floor(s/FSEC) 
    s=s-y*FSEC 
    y=y*4+BASE_YEAR         -- 1970, 1974, 1978, ... 
    if s>=YSEC then 
        y=y+1           -- 1971, 1975, 1979,... 
        s=s-YSEC 
        if s>=YSEC then 
            y=y+1       -- 1972, 1976, 1980,... (leap years!) 
            s=s-YSEC 
            if s>=LSEC then 
                y=y+1   -- 1971, 1975, 1979,... 
                s=s-LSEC 
            else        -- leap year 
                mdays=_lpdays 
            end 
        end 
    end 
    j=floor(s/DSEC) 
    s=s-j*DSEC 
    local m=1 
    while mdays[m]<j do m=m+1 end 
    m=m-1 
    local d=j-mdays[m] 
    -- Calculate day of week. Sunday is 0 
    w=(floor(t/DSEC)+BASE_DOW)%7 
    -- Calculate the time of day from the remaining seconds 
    h=floor(s/3600) 
    s=s-h*3600 
    n=floor(s/60) 
    s=s-n*60 
    return ((y.."/"..m.."/"..d.." - "..string.format("%02d:%02d",h,s))) 
end 

can someone help me pls :(

Link to comment

The problem appears to be in your database, first try to access your database using another client like phpmyadmin (if available) or a terminal window, if that doesn't work then you must login as root and grant your user all needed privileges to that database, don't forget to flush when you're done. Here's some further information that might help: http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw?rq=1

It doesn't seem to be any issues in your Lua code, dbConnect is still preferable and shouldn't have any trouble connecting to a mysql database.

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