CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Join Date
    Sep 2011
    Posts
    12

    Re: adodb mysql connection troubles

    I think I have the privileges setup accordingly... I've been able to connect to the database just fine with the php web-app running on servers at various locations (my testing server as well, an off-site mirror as well as their in-house server)



    ==== mySql User Privileges Table =====
    User Host Password Global privileges 1 Grant

    Any % No USAGE No
    Any localhost No USAGE No
    pma localhost No USAGE No
    root 127.0.0.1 Yes ALL PRIVILEGES Yes
    root localhost Yes ALL PRIVILEGES Yes
    dbusr01 % No ALL PRIVILEGES Yes
    dbusr01 localhost No ALL PRIVILEGES Yes

    I've also tried setting up a password for dbusr01, and it still doesn't want to work.

  2. #17
    Join Date
    Sep 2011
    Posts
    12

    Re: adodb mysql connection troubles

    I installed the mySql workbench, and it still isn't connecting and doesn't offer any better error message and just stops responding.

    I'm starting to agree that the server may not be properly configured for remote access? (but why would it work from php?)

    Maybe I should give up for now and talk with the guy who setup the server to see if he can figure it out.

  3. #18
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: adodb mysql connection troubles

    dbusr01 % No ALL PRIVILEGES Yes

    This should mean you can connect from anywhere. On your local system, do you have a firewall on that could be blocking outgoing ports?

    Are all the servers that can connect on a local LAN or from anywhere. Is your system on the local lan? What is between your system and the MySQL database? Could something there be blocking access?

    I think this is probably more of a networking/firewall issue now. Try this

    Open a command prompt on your system.

    Type in

    telnet xxx.xxx.xxx.xxx 805

    Do you get anything back? If so you are talking to the mysql computer and it is not a networking issue it is the setup in MySQL. If not, somthing is blocking you from talking to the mysql computer.

  4. #19
    Join Date
    Sep 2011
    Posts
    12

    Re: adodb mysql connection troubles

    Quote Originally Posted by sotoasty View Post

    On your local system, do you have a firewall on that could be blocking outgoing ports?
    -- No. I don't run anything on this machine (xp) except for an outdated version of avast. But I've tried from my windows 7 machine too, and same deal.

    Quote Originally Posted by sotoasty View Post

    Are all the servers that can connect on a local LAN or from anywhere. Is your system on the local lan? What is between your system and the MySQL database? Could something there be blocking access?
    The computers that can connect with php are in various cites in the clients offices. I am fairly certain they are not setup on a local LAN. I am 600km away connecting as I usually do through the internet.

    Quote Originally Posted by sotoasty View Post

    Type in

    telnet xxx.xxx.xxx.xxx 805

    Do you get anything back?
    From telnet at the command prompt, I see it quickly flash "connection successful" and then just a blank screen. I tried using the HyperTerminal gui, and it also seems to connect. Are there any command in particular I should be trying to send?

    When I type "exit" (or even "hello") and hit return from the command prompt version, i get the following:

    ===============

    <br />
    <b>Notice</b>: Undefined index: HTTP_HOST in <b>C:\xampp\htdocs\index.ph
    p</b> on line <b>7</b><br />
    <br />
    <b>Warning</b>: Cannot modify header informat
    ion - headers already sent by (output started at C:\xampp\htdocs\index.php:7) in
    <b>C:\xampp\htdocs\index.php</b> on line <b>8</b><br />


    Connection to host lost.

    D:\USERS\SCOTTS~1>
    ================

    That's a php error. It usually has to do with whitespace before initializing a new session or a header() command after output. The index page it's complaining about though is never used -- we use one in a deeper directory as the main index for the webapp. Just the same, I've renamed the existing index.php, and replaced it with a file containing <?php echo "hello"; ?>. Odly, however, I still get the same error message (I did the update via ftp - it should have had an immediate effect, right?)... so how is it still finding and reading this file? And how could this have anything to do with establishing an odbc connection to the mySql database?

  5. #20
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: adodb mysql connection troubles

    It means the problem is likely in the driver. Telnet can connect, as the message told you. You can't really do anything else on that port...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #21
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: adodb mysql connection troubles

    To connect to a mysql server what you should get is something like...

    Connected to 192.168.2.11
    Escape character is '^]'.
    4
    5.0.77

    What you are seeing is a connection to some sort of web server. My next question is what happens if you telnet to the same server at port 3306?

    To re-cap, it is not your odbc setup, at least at this point, it is finding what port your MySQL server is on and how to access it.

    ETA:

    So if you have access to the phpadmin, does it show you the config file for mysql?? If so, could you post that, or possible check to maybe the PORT that mysql is running on?

    Here is my configuration file....

    Code:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    
    # Disabling symbolic-links is recommended to prevent assorted security risks;
    # to do so, uncomment this line:
    # symbolic-links=0
    skip-host-cache
    skip-name-resolve
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    As you can tell it is very basic, with most things set up by default.
    Last edited by sotoasty; September 23rd, 2011 at 03:38 PM.

  7. #22
    Join Date
    Sep 2011
    Posts
    12

    Re: adodb mysql connection troubles

    Quote Originally Posted by sotoasty View Post
    ...is what happens if you telnet to the same server at port 3306?
    it takes a very long time, then finally returns with an error saying "...Could not open connection to the host, on port 3306: Connect failed"


    Quote Originally Posted by sotoasty View Post
    So if you have access to the phpadmin, does it show you the config file for mysql??
    I've looked all through php with no luck. I searched as high as I can go in the directory structure from ftp access as well, with no luck.

    I have sent an email to the server admin asking him to have a look at the config file for me. I agree that it really sounds like a port problem. That's kind of the direction I was leaning in from the start, but I wanted to be sure of it before asking. Hopefully I will hear back from him early next week and I will let you know what we find out... thanks for the input so far

  8. #23
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: adodb mysql connection troubles

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #24
    Join Date
    Sep 2011
    Posts
    12

    Talking Re: adodb mysql connection troubles

    Hello to anyone who might come across this thread as well as the people that contributed to this point...

    This is what the server administrator replied back to me with:
    =========
    Among other things, I deleted all of my port forwarding and binding and started from scratch but that didn't make a difference. Looked at the permissions for the database, and everything looked good there as well. Finally found that I had to make changes to the mysql.ini file, specifically specify tcp/ip there and bind an IP address there as well.
    =========

    So things are finally back to normal on my end.... Problem solved!

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured