S!LenTzZ Posted December 30, 2015 Share Posted December 30, 2015 Hey Community i hope someone of u can help me by my problem with this multigamemode script. When i start the resource dbData comes this error: ERROR: [gamemodes]/[RoA]/dbData/server.lua:13: dbConnect failed; Access denied for user 'ni209194_1sql1'@'%' to database 'mybb' Link to comment
Captain Cody Posted December 30, 2015 Share Posted December 30, 2015 Insufficient privileges for the user. Link to comment
S!LenTzZ Posted December 30, 2015 Author Share Posted December 30, 2015 how i can give the script sufficient privileges? Link to comment
Captain Cody Posted December 30, 2015 Share Posted December 30, 2015 Well assuming this is mySQL I do not know. Link to comment
S!LenTzZ Posted December 30, 2015 Author Share Posted December 30, 2015 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
Mr_Moose Posted December 30, 2015 Share Posted December 30, 2015 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
S!LenTzZ Posted December 31, 2015 Author Share Posted December 31, 2015 Mhh it doesnt work and i do all 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