ICTNUT Posted February 18, 2009 Posted February 18, 2009 Hi Guys, I have 2 server (Ubuntu 8.10) one setup as a web server and the other as a mysql server I want to allow the web server (moodle) to connect to the dbserver but I am getting access denied issues. Does anyone know what I need to do to allow remote db access from the web server? From what I can see on the Ubuntu forums there are no firewall restrictions and this would seem to be correct cos if i do: mysql -h 192.168.0.17 -u moodleuser -p I get asked for the password and upon entering this i get: ERROR 1044 (42000): Access denied for user 'moodleuser'@'%' to database 'moodle' Any ideas?
Willott Posted February 18, 2009 Posted February 18, 2009 If there's no firewall in place, it would suggest that the moodle user added to the database server is allowed from local only. Take a look at the SQL Grant statement (can't remember the syntax, sorry), and ensure that you grant privileges for the moodle user at another IP (I think you can specify only the IP of the connecting machine, ie the webserver, if not, specify from all then lock down with firewall to only allow MySQL connections from the webserver IP). I tend to use phpmyadmin for a lot of my DB admin, means that I don't have to remember syntax... hence why I don't remember the GRANT statement! 1
ICTNUT Posted February 18, 2009 Author Posted February 18, 2009 The user has full control of that DB on the mysql server and is allowed to connect from any host (%) so in thoery it should work
webman Posted February 18, 2009 Posted February 18, 2009 Look for the bind-address option in /etc/mysql/my.cnf - it's around line 69 in my file. It is probably set to 127.0.0.1 - change it to the LAN IP address of the server. 1
ICTNUT Posted February 18, 2009 Author Posted February 18, 2009 Nope done that set it to the Server IP Address
Willott Posted February 18, 2009 Posted February 18, 2009 checked port open using netstat on box, and checked port open from external box (nmap possibly)? 1
ICTNUT Posted February 18, 2009 Author Posted February 18, 2009 netstat -l shows: tcp 0 0 192.168.0.11:mysql *:* LISTEN Will assume listening on the box Any other ideas?
Willott Posted February 18, 2009 Posted February 18, 2009 Checked port open from another box (using nmap or telnet)? 1
ICTNUT Posted February 18, 2009 Author Posted February 18, 2009 WinXP Sp2 Telnet Reports: 5.0.67-0Ubuntu6 So looks good also
ICTNUT Posted February 18, 2009 Author Posted February 18, 2009 Ok redid the GRANT privilages and rebooted the server "a couple of times" and all seems to be working Thanks guys for the pointers.
Willott Posted February 18, 2009 Posted February 18, 2009 Glad you got it sorted. I was just about to check that the keyboard keys weren't moving and making you type the incorrect password as that was the only other solution I could see! 1
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