Wysłany: 2016-09-16, 18:46
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
Witam mam takie problem z tym kodem:
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
-- Settings
DBHandler = nil
DBName = "565153_test"
DBUser = "565153"
DBPass = "******"
DBHost = "sql.pukawka.pl"
-- Functions
function dbSet (...)
if not {...} then return end
local stringe = dbPrepareString ( DBHandler ,...)
local query = dbExec ( DBHandler , stringe )
return query
end
function dbGet (...)
if not {...} then return end
local stringe = dbPrepareString ( DBHandler ,...)
local query = dbQuery ( DBHandler , stringe )
local result = dbPoll ( query , - 1 )
return result
end
addEventHandler ( "onResourceStart" , resourceRoot , function()
DBHandler = dbConnect ( "mysql" , "dbname=" .. DBName .. ";host=" .. DBHost .. "" , DBUser , DBPass , "share=1;autoreconnect=1" )
if DBHandler then
outputDebugString ( "* Connect to server MYSQL..." )
dbSet ( "SET NAMES utf8" )
else
outputDebugString ( "* No Connecting to server MYSQL.." )
end
end )
local SQL_LOGIN = "565153"
local SQL_PASSWD = "******"
local SQL_DB = "565153_test"
local SQL_HOST = "sql.pukawka.pl"
local SQL_PORT = 3306
local root = getRootElement ()
local SQL
local function connect ()
SQL = dbConnect ( "mysql" , "DBName=" .. SQL_DB .. ";host=" .. SQL_HOST .. "" , SQL_DBUSER , SQL_PASSWD , "share=1" );
if ( not SQL ) then
outputServerLog ( "BRAK POLACZENIA Z BAZA DANYCH!" )
else
-- mysql_query ( SQL , "SET NAMES utf8" )
-- outputServerLog ( "Modul mysql polaczony!" )
end
end
local function keepAlive ()
if ( not mysql_ping ( SQL )) then
outputServerLog ( "Zerwane polaczenie z baza danych, nawiazywanie..." )
connect ()
end
end
addEventHandler ( "onResourceStart" , getResourceRootElement (),function()
connect ()
setTimer ( keepAlive , 30000 , 0 )
end )
function esc ( value )
return mysql_escape_string ( SQL , value )
end
function pobierzTabeleWynikow ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then
outputDebugString ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
outputServerLog ( "mysql_query failed: (" .. mysql_errno ( SQL ) .. ") " .. mysql_error ( SQL ))
return nil
end
local tabela ={}
for result , row in mysql_rows_assoc ( result ) do
table . insert ( tabela , row )
end
mysql_free_result ( result )
return tabela
end
function pobierzWyniki ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then return nil end
row = mysql_fetch_assoc ( result )
mysql_free_result ( result )
return row
end
function zapytanie ( query )
local result = mysql_query ( SQL , query )
if ( result ) then mysql_free_result ( result ) return true end
return
end
function insertID ()
return mysql_insert_id ( SQL )
end
function affectedRows ()
return mysql_affected_rows ( SQL )
end
function fetchRows ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then return nil end
local tabela ={}
while true do
local row = mysql_fetch_row ( result )
if ( not row ) then break end
table . insert ( tabela , row )
end
mysql_free_result ( result )
return tabela
end
function getSQLLink ()
return SQL
end
Jak pr?buje si? po??czy? to mam taki b??d
[ 2016 - 09 - 16 18 : 43 ] ERROR : [ Skrypty ]/ ogrpg - db / s_db . lua : 54 : dbConnect failed ; Access denied for user 'root' @ '193.33.177.12' ( using password : YES )
Je?eli kto? si? tu na tym zna to prosi?bym o pomoc.
Za pomoc
Ostatnio zmieniony przez STOPseba 2016-09-16, 19:04, w całości zmieniany 2 razy
Wysłany: 2016-09-16, 20:10
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
host spr?buj zamieni? na :
Wysłany: 2016-09-16, 20:53
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
"eject" napisał/a :host spr?buj zamieni? na :
Dalej nic
Wysłany: 2016-09-16, 21:00
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
Czy ty serio nie widzisz, ?e skrypt pr?buje si? ??czy? jako u?ytkownik 'root' i z innym hostem ni? masz podane w configu?
Pinging sql.pukawka.pl [193.33.177.152]
Tak?e, masz ten config chyba w innym zasobie ni? odpalasz...
Wysłany: 2016-09-16, 21:03
eject
kurdebele
Wiek: 30 Na forum: 3659 dni Posty: 182
Nick w MP: EjecT
Piwa : 2456
w hoscie daj
Wysłany: 2016-09-16, 21:32
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
"eject" napisał/a :w hoscie daj
Co mu da sama zmiana hostu, skoro skrypt i tak si? ??czy z inn? nazw? uzytkownika i pewnie z innym has?em tak?e.
Tka to jest jak pobieracie g?wnanie skrypty z internetu i nawet nie potraficie ich uruchomi?...
Wysłany: 2016-09-17, 14:02
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
Dzi?ki ka?demu za pomoc juz sobie porazi?em z tym problemem
Tagi: mysql
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: