hey, i have changed the mysql config and i think it doesnt work. do you need to do anything else than changing config? (yes i do have mysql host ) (hostgator)
Do you have the MySQL module and lib file?
"Download andyvincent's/Drakehawke's gm_MySQL OO module and read the guide here:
[URL="http://www.facepunch.com/showthread.php?t=1220537"]http://www.facepunch.com/showthread.php?t=1220537[/URL]"
yeah i have those both in my files but it still wont work idk why ( i have no tables in mysql)
please help ..
did you enable the module in the mysql settings file?
did you check to see if there were any errors in the server's console (saying it couldn't connect, query failed, etc.)
i checked console no errors , what module ? i only did the config file in darkrp files
[url]https://github.com/FPtje/darkrpmodification/blob/master/lua/darkrp_config/mysql.lua[/url]
Did you make sure that line 8 is true
yeah!
[editline]14th December 2013[/editline]
should it have createn any tables in the mysql database or i have to bring them somehow therE?
[editline]14th December 2013[/editline]
beacouse i have empty database o.o
[editline]14th December 2013[/editline]
here it is
[QUOTE]
RP_MySQLConfig.EnableMySQL = true -- Set to true if you want to use an external MySQL database, false if you want to use the built in SQLite database (garrysmod/sv.db) of Garry's mod.
RP_MySQLConfig.Host = "192.254.184.33" -- This is the IP address of the MySQL host. Make sure the IP address is correct and in quotation marks (" ")
RP_MySQLConfig.Username = "secret" -- This is the username to log in on the MySQL server.
-- contact the owner of the server about the username and password. Make sure it's in quotation marks! (" ")
RP_MySQLConfig.Password = "secret" -- This is the Password to log in on the MySQL server,
-- Everyone who has access to FTP on the server can read this password.
-- Make sure you know who to trust. Make sure it's in quotation marks (" ")
RP_MySQLConfig.Database_name = "deathrow_darkrp" -- This is the name of the Database on the MySQL server. Contact the MySQL server host to find out what this is
RP_MySQLConfig.Database_port = 3306 -- This is the port of the MySQL server. Again, contact the MySQL server host if you don't know this.[/QUOTE]
You have to set up the database, call it "deathrow_darkrp" and it will create the tables.
well... i have database called that but it doesnt create tables.
If your webhost uses CPanel or something similiar find where it says "Remote MySQL" make sure you have the % wildcard added.
Note: I've recently discovered many cheaper web and database hosts do not allow remote mysql connections at all.
ok this will tell you (and me) what is happening
create a file in garrysmod/lua call it sqltest.lua
[code]
Msg("Starting MySQL Check:\n")
require("mysqloo")
local db = mysqloo.connect( "192.254.184.33", "root", "" , "deathrow_darkrp", 3306)
function db:onConnectionFailed( errorMessage )
Msg("There was an error connecting to the database!\n")
Msg(errorMessage .. "\n")
end
function db:onConnected( )
Msg("Database Connected!\n")
testQuery()
end
function testQuery()
local data = "CREATE TABLE IF NOT EXISTS `test` ( `id` INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) )"
q = db:query(data)
function q:onSuccess( result )
if result then Msg("Connected and queried, success!\n") end
Msg("returned: "..tostring(result).."\n")
end
function q:onError( errorMessage, sql )
Msg("MySQL Query Failure: " .. tostring(errorMessage) .. "\n")
end
q:start()
end
Msg("connecting and sending query.\n")
db:connect()
[/code]
Change the mysqloo.connect information so it fits.
Then in the console put "lua_openscript sqltest.lua"
Paste in this thread what it says
Starting MySQL Check:
connecting and sending query.
is the end result but yet on server says connection failed access denied
Sorry, you need to Log In to post a reply to this thread.