SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL is invisible to HTTP access

    hi

    We installed the latest version of PHP yesterday

    Today we wanted to instal Joomla

    We used the database tool SQL maestro, a visual front-end for MySQL to create the Database and user so we can launch J00MLA

    It was set up correctly with the database at Localhost

    We need to have J00MLA connect to this database and we get this error

    Unable to connect to the database:Could not connect to MySQL

    From the HTTP URL I created a simple test shown here and we get a error message

    <?php
    mysql_connect(localhost, myuser, mypassword) or d.i.e(mysql_error());
    echo Connected to MySQL<br />;
    ?>

    brings back this error message

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

    Turning the firewall on and off makes no difference, I did not try all the fire wall combinations with other changes on the seever /mysql

    please can you make a suggestion as to what this could be. MSQL simply is not visible from HTTP or so it would seem.

    I also installed phpAdmin and tried to login to root and I also got a connection error to the database.

    This is what phpInfo() shows up below

    MySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $

    Directive Local Value Master Value
    mysql.allow_local_infile On On
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host no value no value
    mysql.default_password no value no value
    mysql.default_port no value no value
    mysql.default_socket no value no value
    mysql.default_user no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode Off Off


    Please can someone help

    many thanks

  2. #2
    SitePoint Addict Mal Curtis's Avatar
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    327
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Did you have quotes around localhost?

    PHP Code:
    <?php
    mysql_connect
    (localhostmyusermypassword) or d.i.e(mysql_error());
    echo 
    Connected to MySQL<br />;
    ?>
    or


    PHP Code:
    <?php
    mysql_connect
    ('localhost''myuser''mypassword') or d.i.e(mysql_error());
    echo 
    Connected to MySQL<br />;
    ?>

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    I am sorry, I did have quotes, this is the exact code


    <?php
    mysql_connect('localhost', 'mybuzz', 'testpass') or die(mysql_error());
    echo Connected to MySQL<br />;
    ?>

    Many thanks
    Andrew

  4. #4
    SitePoint Addict Mal Curtis's Avatar
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    327
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Can you connect at the command line?

    In a terminal connect to mysql with the same user and password

    #mysql -u usernamehere -p

    It will then prompt you for the password.

    If this doesn't work perhaps you can provide some more info about your setup, what type of server it is and how mysql was installed?


Bookmarks

Posting Permissions

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