sckatchof Posted December 25, 2012 Share Posted December 25, 2012 hi guys i have problem with connect to mysql : function getMySQLconnection() MySQlc= dbConnect( "mysql", "dbname=Khodja;host=127.0.0.1", "username", "password", "share=1" ) if MySQlc then outputDebugString ( "Server is now connected with the MySQL database!") exports.TNSDxChatBox:CreatDxChatBoxForPlayer(root, "Server is now connected with the MySQL database!", 0,255,0) return true else exports.TNSDxChatBox:CreatDxChatBoxForPlayer(root, "Connection with the MySQL database failed!", 255,0,0) outputDebugString ( "Connection with the MySQL database failed!" ) return false end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), getMySQLconnection ) Error : MySQl/mysql.lua line:2: dbConnect failed; Host 'DELL-PC' is not allowed to connect to this Mysql database server Link to comment
Castillo Posted December 25, 2012 Share Posted December 25, 2012 You must grant all privilegies to your IP on phpMyAdmin if I'm right. Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 You must grant all privilegies to your IP on phpMyAdmin if I'm right. but how can grant all privileges on phpMyAdmin ? Link to comment
Castillo Posted December 25, 2012 Share Posted December 25, 2012 Should be on "Users" tab. Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 Should be on "Users" tab. ok i will try, thanks snake i Link to comment
uhm Posted December 25, 2012 Share Posted December 25, 2012 it's about the "Host" box in the form you must create a new user to allow for it Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 it's about the "Host" boxyou must create a new user to allow for it thank you uhm Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 i have ather problem i can't connect with phpMyadmin !! Link to comment
uhm Posted December 25, 2012 Share Posted December 25, 2012 oh that's no good. could you connect before? did you remove the root account before adding a new one? is the mysql server running on the same server as the php server with phpMyAdmin? windows or linux? Link to comment
Anderl Posted December 25, 2012 Share Posted December 25, 2012 Are you using phpMyAdmin of any webserver? Webservers normally have that option in their control panels, it's not made via phpMyAdmin. Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 oh that's no good. could you connect before? did you remove the root account before adding a new one? is the mysql server running on the same server as the php server with phpMyAdmin? windows or linux? windows 7 but now i change Mysql config it's work with 127.0.0.1/phpMyAdmin but with localhost/phpMyAdmin don't work Forbidden You don't have permission to access /phpmyadmin/ on this server. Link to comment
uhm Posted December 25, 2012 Share Posted December 25, 2012 (edited) ah ok that doesnt have to be a problem, but if you want it fixed there's two possibilities that may cause the problem: 1) your dns server doesnt resolve localhost right; to fix: open start menu and type notepad, then right-click on it and run as admin then choose Open file from notepad and put this in the box for the file name and press enter: %windir%\System32\drivers\etc then choose Show all files and then pick "hosts" then manually add to the end of the file 127.0.0.1 localhost and save and check if it works if theres another entry for localhost but the ip is not 127.0.0.1 or ::1 write it down and remove it and maybe investigate if it wasnt added by a virus 2) the config of your webserver program somehow blocks the use of that hostname but this is probably not it and its pretty advanced troll spoiler actually that localhost thing may be the very cause that you got that error of "Host 'DELL-PC' is not allowed to connect to this Mysql database server" in the first place. is that solved now? I think you should really check your host file (step 1) and check if it doesnt weirdly resolve to your external ip or an internal network ip Edited December 25, 2012 by Guest Link to comment
sckatchof Posted December 25, 2012 Author Share Posted December 25, 2012 Problem fixed. thank you uhm for help, thanks everybody 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