Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-09-20, 20:05


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Witam, dzi? kupi?em VPS.
Parametry:
Procek: 4x 3.0 GHZ
RAM: 6gb
DYSK SSD: 75GB
Pami?? SWAP: 512
Miejscowo??: Pozna?
Panel zarzo: HyperVM

Gdy zainstalowa?em GM i po??czy?em z MySQL nie po??czy?o mi bazy danych wywali?o mi b??d:



    DBHandler=dbConnect("mysql""dbname="..DBName..";host="..DBHost..""DBUserDBPass"share=1")


Dane s? na 200% dobrze po??czone.

Z g?ry THX za pomoc stawiam :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:08


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
A czy na tym VPS'ie utworzy?e? lub mia?e? ju? utworzon? baz? danych MySQL?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:10


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Nie korzystam ze swojej hostingowej

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:23


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

Poka? ca?y kod.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:26


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%

-- Settings
DBHandler=nil
DBName="db_10972"
DBUser="db_10972"
DBPass="*******"
DBHost="mysql-ols1.ServerProject.pl"

-- Functions
function dbSet(...)
    if not {...} then return end
    local query=dbExec(DBHandler, ...)
    return query
end

function dbGet(...)
    if not {...} then return end
    local query=dbQuery(DBHandler, ...)
    local result=dbPoll(query, -1)
    return result
end

addEventHandler("onResourceStart"resourceRoot, function()
    DBHandler=dbConnect("mysql""dbname="..DBName..";host="..DBHost..""DBUserDBPass"share=1")
    if DBHandler then
        outputDebugString("* Polaczono z MYSQL...")
    else
        outputDebugString("* Brak polaczenia z MYSQL..")
    end
end)


Has?a nie podam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:28


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

Nie wiem czemu to nie dzia?a, wszystko w kodzie jest okej, widocznie co? musi by? nie tak w VPS tym co kupi?e?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:45


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Utworzy?em MySQL na VPS kod:


-- Settings
DBHandler=nil
DBName="root"
DBUser="root"
DBPass="*****"
DBHost="localhost"

-- Functions
function dbSet(...)
    if not {...} then return end
    local query=dbExec(DBHandler, ...)
    return query
end

function dbGet(...)
    if not {...} then return end
    local query=dbQuery(DBHandler, ...)
    local result=dbPoll(query, -1)
    return result
end

addEventHandler("onResourceStart"resourceRoot, function()
    DBHandler=dbConnect("slife""dbname="..DBName..";host="..DBHost..""DBUserDBPass"share=1")
    if DBHandler then
        outputDebugString("* Polaczono z MYSQL...")
    else
        outputDebugString("* Brak polaczenia z MYSQL..")
    end
end)


B??d:


[...] dbConnect failedNot valid type 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:52


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Zobacz tak:

-- Settings
DBHandler=nil
DBName="root"
DBUser="root"
DBPass="*****"
DBHost="localhost"

-- Functions
function dbSet(...)
    if not {...} then return end
    local query=dbExec(DBHandler, ...)
    return query
end

function dbGet(...)
    if not {...} then return end
    local query=dbQuery(DBHandler, ...)
    local result=dbPoll(query, -1)
    return result
end

addEventHandler("onResourceStart"resourceRoot, function()
    DBHandler=dbConnect("mysql""dbname="..DBName..";host="..DBHost..""DBUserDBPass"share=1")
    if DBHandler then
        outputDebugString("* Polaczono z MYSQL...")
    else
        outputDebugString("* Brak polaczenia z MYSQL..")
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 20:56


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Fanciak, B??d jak na pierwszym ss

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 21:05


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

-- Functions
function dbSet(...)
    if not {...} then return end
    local query=dbExec(DBHandler, ...)
    return query
end

function dbGet(...)
    if not {...} then return end
    local query=dbQuery(DBHandler, ...)
    local result=dbPoll(query, -1)
    return result
end

addEventHandler("onResourceStart"resourceRoot, function()
    DBHandler=dbConnect("mysql""dbname=x;host=y""nazwa_uzytkownika","haslo","share=1")
    if DBHandler then
        outputDebugString("* Polaczono z MYSQL...")
    else
        outputDebugString("* Brak polaczenia z MYSQL..")
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 21:08


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Fanciak, Nic ;/ Nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 21:33


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

Rudy., Kod Fanciaka powinien dzia?a?.

W po??czeniu w typ poda?e? nieprawid?ow? sk?adnie:
slife


Dlatego wyskoczy? Ci b??d:
[...] dbConnect failedNot valid type 


Ustaw tak jak on Ci poda? zamie? to
slife


Na
mysql


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 21:39


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Terr9909, Nadal to samo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 22:00


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

For MySQL it is a list of key=value pairs separated by semicolonsSupported keys are:
dbnameName of the database to use e.gdbname=test
hostHost address e.ghost=127.0.0.1
portHost port e.gport=1234 (optionaldefaults to standard MySQL port if not used)
unix_socketUnix socket or named pipe to use (optional)
charsetCommunicate with the server using a character which is different from the default e.gcharset=utf8 (optional)


hostHost address e.ghost=127.0.0.1


Spr?buj w host wstawi? 127.0.0.1

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-20, 22:15


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Terr9909, Nadal... ;( Nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Tagi: [mysql]nie :: łączy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » [MYSQL]Nie łączy Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku