+ Post New Thread
Results 1 to 11 of 11
*nix Thread, Web server to DB server problems in Technical; Hi Guys, I have 2 server (Ubuntu 8.10) one setup as a web server and the other as a mysql ...
  1. #1
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63

    Web server to DB server problems

    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?

  2. #2

    Join Date
    Dec 2008
    Location
    Nottingham
    Posts
    575
    Thank Post
    38
    Thanked 115 Times in 105 Posts
    Rep Power
    47
    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!

  3. Thanks to Willott from:

    ICTNUT (18th February 2009)

  4. #3
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    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

  5. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,422
    Thank Post
    645
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328
    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.

  6. Thanks to webman from:

    ICTNUT (18th February 2009)

  7. #5
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    Nope done that set it to the Server IP Address

  8. #6

    Join Date
    Dec 2008
    Location
    Nottingham
    Posts
    575
    Thank Post
    38
    Thanked 115 Times in 105 Posts
    Rep Power
    47
    checked port open using netstat on box, and checked port open from external box (nmap possibly)?

  9. Thanks to Willott from:

    ICTNUT (18th February 2009)

  10. #7
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    netstat -l shows:

    tcp 0 0 192.168.0.11:mysql *:* LISTEN
    Will assume listening on the box

    Any other ideas?

  11. #8

    Join Date
    Dec 2008
    Location
    Nottingham
    Posts
    575
    Thank Post
    38
    Thanked 115 Times in 105 Posts
    Rep Power
    47
    Checked port open from another box (using nmap or telnet)?

  12. Thanks to Willott from:

    ICTNUT (18th February 2009)

  13. #9
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    WinXP Sp2 Telnet Reports:

    5.0.67-0Ubuntu6
    So looks good also

  14. #10
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    Ok redid the GRANT privilages and rebooted the server "a couple of times" and all seems to be working

    Thanks guys for the pointers.

  15. #11

    Join Date
    Dec 2008
    Location
    Nottingham
    Posts
    575
    Thank Post
    38
    Thanked 115 Times in 105 Posts
    Rep Power
    47
    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! :P

  16. Thanks to Willott from:

    ICTNUT (18th February 2009)



SHARE:
+ Post New Thread

Similar Threads

  1. Web - File Server
    By acrobson in forum How do you do....it?
    Replies: 3
    Last Post: 24th January 2009, 12:20 PM
  2. Web Server Spec
    By My220x in forum Hardware
    Replies: 14
    Last Post: 21st April 2008, 04:39 PM
  3. Server problems?
    By ICT_GUY in forum Hardware
    Replies: 3
    Last Post: 5th February 2008, 01:48 PM
  4. Dead Web Server :(
    By plexer in forum Hardware
    Replies: 3
    Last Post: 19th April 2007, 03:21 PM
  5. back up web server
    By beeswax in forum How do you do....it?
    Replies: 6
    Last Post: 12th June 2006, 10:03 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •