The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

odbc for connection

Discussion in 'General Discussion' started by modom, Apr 28, 2009.

  1. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    Hi,

    I have a client who wants to connect to his database on cpanel using filemaker pro.

    How can I tell if the odbc driver is compiled on my server so he can connect?

    He could connect on the Plesk server.

    I think I have to run easy apache for this but I just ran it last night to add more security to php.

    Thanks!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I am not familiar with FileMaker Pro. Are they trying to connect to a MySQL database, a PostgreSQL database or another type of database?
     
  3. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    Yes he is trying to connect to the mysql database first as he told me this morning and then he uses file maker so file maker has nothing to do with his connection.

    He put his IP of his home computer in the remote mysql section but I'm wondering if I did something since I ran easy apache 2 days ago using "PHP Encryption and Image Manipulation" and think I saw something about the ODBC but now cannot remember. I checked off other things to add though.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    PHP's ODBC is used for PHP making database connections to other servers (such as MS SQL servers). It has no relation to the ODBC your customer may need to have installed on their workstation to connect to their MySQL database from their workstation.

    MySQL isn't directly affected by EasyApache so it is very doubtful that did anything to affect things with regards to a remote client connecting to your MySQL server.

    One thing I would encourage your customer to do when their database connection is malfunctioning is always get their public IP address (such as from a site like WhatIsMyIP.com) and ensure that is in their access list. If not, then they add it and try again.

    Also, the client will need to authenticate using the full database username and full database name. So if they created a database "stuff" then the database name would be "username_stuff" where username represents their cPanel username. The same prefixing occurs on database usernames as well. This is something a user from another control panel may not immediately understand.
     
  5. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    When he was on the Plesk server before we changed to cPanel he could connect to his database but not now for some reason.

    Is this correct that I already have the ODBC driver because it is in PHP?

    I know nothing about mysql remote connections.
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    cPanel/WHM blocks all remote connections except those that are explicitly allowed by allowing that IP address. This is different than what other control panels may do

    Just because you have PHP doesn't mean you have ODBC.

    This application the user is running, is it programmed in PHP? Is it running on your server? If the answer to either of those questions is no, then ODBC support being compiled into PHP is likely irrelevant.

    That's okay, just use the cPanel interface to allow remote connections (from that user's workstation) and follow the advice I provided above. You can read more about this in our documentation at:

    http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/RemoteMySQL
     
  7. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    The application my customer is running is the osCommerce store which is php programming and it is on my cpanel server.

    This is from my client:
    Thank you for help.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Are you able to make a connection to the MySQL server from either a remote workstation or remote server?

    If you're not able to connect remotely TO your server (even with allowing the IP) then there may be server-side issue such as firewalls blocking access.

    If you're able to connect but not your customer, it could just be something with what the customer is doing.
     
  9. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    If you are running a hardware or sofware firewall, either on your network or on your cpanel machine, you need to make sure that TCP 3306 is open for incoming connections from the IP address of your customer.

    Then your customer needs to go into his control panel interface and set up his mysql user to be allowed to make connections from the IP address of his machine - This can be done under the MySQL section in Cpanel.

    Your customer can test to see if it is an issue where you or him have a firewall blocking his ability to access TCP 3306.

    He should:
    1. Open a DOS prompt
    2. Type in: telnet IP_OF_YOUR_CPANEL_SERVER 3306

    He should get a banner such as:

    Connected to hostname.of.your.server (xxx.xxx.xxx.xxx).
    Escape character is '^]'.
    >
    5.0.67-communityÛÖ.&O<{zrLd,6{.of1auK



    If he gets no such banner, then a firewall is blocking his ability to access.

    If he DOES get such a banner, then he needs to make sure his MySQL user has the needed permission to make a connection from a remote server - Again, that can be done within the Cpanel interface.

    Mike
     
  10. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    Thank you!

    It was a firewall problem that cpanel helped me with but I'm still unclear as to what the "Additional MySQL Access Hosts" list is for in WHM. There is not anything setup in there and I'm not understanding if this needs to be setup for future reference.

    My customer has his home IP setup in his cpanel space hosts section.

    I know I'm not setting up a "Remote MySQL server" that is in WHM.

    I just want to make sure my customer's access to his database is setup properly in addition to the firewall information you just provided so if another customer needs this there won't be any problems.

    Thanks!
     
  11. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    As long as your firewall allows incoming TCP 3306, the rest can be done by each individual from within their Cpanel by adding their IP address that they wish to connect from.

    1. The "Additional MySQL Access Hosts" accomplishes a similar thing, but is managed by you. And you dont' want to have to be adding an IP address each time a customer requests. Let them do it via their Cpanel interface.

    2. I personally think its a bad idea [but possibly unavoidable for you] to allow your customers to connect remotely to MySQL. Why? You may find your customers using your MySQL server for external applications that cause unnecessary resource usage in your MySQL. Remote MySQL connections over TCP over a typical intternet route are not robust, take longer to complete, and may increase MySQL resource usage. But you may have no choice but to allow this to keep a customer such as the one you are referring to now.

    Mike
     
  12. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    Thank you! This has been very helpful and think I am catching on.
     
  13. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    You are welcome :)

    mike
     
  14. modom

    modom Well-Known Member

    Joined:
    May 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Arkansas
    Hi,

    I kept getting a security warning in the csf firewall on my server about having listed the mysql port for TCP_IN so I need another solution.

    Would this work?

    1. put the customer's home IP in the allow list on the firewall

    2. would I also put the customer's home IP in the mysq additional hosts of whm? In whm it says to put a username and password with the host name but in the cpanel docs it says to just put a host name or number. How do you set this up?

    3. what host name would the customer put in his cpanel remote mysql section?

    Thanks!
     
  15. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Perhaps you entered it incorrectly? See below.

    Sure you could do that. But you should be able to just enter this into WHM / Plugins / CSF Firewall / Firewall Allow IPs :

    tcp:in:d=3306:s=xxx.xxx.xxx.xxx

    - where xxx.xxx.xxx.xxx = your customers static IP address

    You'll then have to restart CSF.

    WHM / SQL Services / Additional MySQL Access Hosts

    In the box, enter in the IP address of your customer's machine

    Host (% wildcard is allowed): xxx.xxx.xxx.xxx

    - where xxx.xxx.xxx.xxx = your customers static IP address
    Mike
     
Loading...

Share This Page