Khaled Abdullah Posted September 23, 2013 Share Posted September 23, 2013 Hello, We have problem in the game when connect to database not accept and appear this error " ERROR:dbConnect failed; Could not connect [string "return dbConnect ("mysql",dbname=wmisc_W..."]" we have latest mysql verson on cpanel/whm server linux 64bit Centos this is code info srun dbConnect ( "mysql", "dbname=RDFGR_T;host=127.0.0.1", "RDFGR_TDGWR", "PASSWORD" ) We tried change the host to host=localhost and also the real IP to the server and not working And i test the mysql and same database from php script and working good but in the game not working Please how can solve this issue ? Thanks Link to comment
theDavid Posted September 23, 2013 Share Posted September 23, 2013 Try this one: handler = dbConnect( "mysql", "dbname=(your database name);host=(server ip or localhost)", "(mysql user)", "(mysql password)", "share=1" ) Link to comment
myonlake Posted September 23, 2013 Share Posted September 23, 2013 Is your game server running on the same server as the MySQL server? Sometimes hosting companies block external MySQL connections (usually always) and it might be the reason for not being able to connect. However, using the runcode-resource for connecting to database is not a good idea, at least that's my own personal opinion. You should create a Lua file and connect to database there. Then make an exported function for returning the database connection so you can use it outside of the resource as well. Link to comment
ixjf Posted September 23, 2013 Share Posted September 23, 2013 You need to 'tell' the MySQL server to accept remote connections, via the cPanel or phpMyAdmin. Link to comment
Khaled Abdullah Posted September 23, 2013 Author Share Posted September 23, 2013 MySQL is already on the same server that has the games: But I never Broken Where it work Cęlem when you try to connect from two But I cant contact through the game Nor I've tried Halolo a lot and I was not working This error appears ERROR: dbConnect failed; Could not connect [string "return dbConnect (" mysql ", dbname = FER_TR ..."] Link to comment
MTA Team ccw Posted September 25, 2013 MTA Team Share Posted September 25, 2013 MySQL doesn't have networking enabled by default. I think you have to comment the line skip-networking in my.cnf, like this: # skip-networking Link to comment
Khaled Abdullah Posted September 26, 2013 Author Share Posted September 26, 2013 MySQL doesn't have networking enabled by default.I think you have to comment the line skip-networking in my.cnf, like this: # skip-networking Did not work I have tried Do you connect to the database you need certain files I tried all the methods did not work Link to comment
=KoG=Rouche Posted November 21, 2013 Share Posted November 21, 2013 Same problem :-/ Seems there isn't a solution ... 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