Web Interface - could not connect. #210


  • New
  • Defect
Open
Assigned to _ForgeUser7076494
  • _ForgeUser7498523 created this issue Feb 17, 2012

    What is the problem?
    I cant connect database with webinterface it just shows:

    Could not connect to MySQL Database!

    What steps will reproduce the problem?
    1.
    2.
    3.

    What version of HawkEye are you using (shown in console during start-up)?
    1.0.5b

    Show me any console errors and/or your start-up console message for HawkEye

    Show me your config.yml and/or your config.php (REMOVE YOUR PASSWORD)

    <?php
        ///////////////////////////////////////////////////
        //         HawkEye Interface Config File         //
        //                 by oliverw92                  //
        ///////////////////////////////////////////////////
        //     Edit the config array below with your     //
        //     details. Make sure all strings are        //
        //     escaped. If you can't work this out,      //
        //     ask in the thread on bukkit.org.          //
        ///////////////////////////////////////////////////
        $hawkConfig = array(
                        //Enter your MySQL database information
                        //Do not change 'dbTable'
                        "dbHost"  => "mysqleu1.fragnet.net:3306",
                        "dbDbase" => "1359_clientdb",
                        "dbUser"  => "1359",
                        "dbPass"  => "1*************2",
                        "dbTable" => "hawkeye",
                        "dbPlayerTable" => "hawk_players",
                        "dbWorldTable" => "hawk_worlds",
                        //Set this to the password you want people to have to use to access the interface
                        //Leave blank for no password
                        "password" => "",
                        //Default radius to search for if user supplies a location
                        "radius" => 30,
                        //Limit the maximum number of results that can be returned. Do not use quotes
                        //Set to 0 for no limit
                        "maxResults" => 0,
                        //Language pack - default is english.php
                        //You can create your own based off the english.php file,
                        //then change the name below to your language file name
                        "langFile" => "english.php",
                        //Log queries to log.txt
                        //Useful to keep track of who is querying what
                        "logQueries" => true,
                        //Use forum for authentication?
                        //Default is false
                        "forumAuth" => false,
                        //The relative location for the forum to this file.
                        //Default is "../forum/"
                        "forumDir" => "../forum/",
                        //The type of forum that will be used.
                        //Default is phpbb3
                        //Available types are: phpbb3 and smf
                        "forumType" => "smf"
                        );
        //The user wants to use forumAuth
        if ($hawkConfig["forumAuth"])
        {
            //We need to require the specified forumType.  Hopefully we support it (Or the user is using their own file)
            require('./forumAuth/'.$hawkConfig['forumType'].'.php');
        }
        $con = mysql_connect($hawkConfig["dbHost"], $hawkConfig["dbUser"], $hawkConfig["dbPass"]);
        if (!$con)
            return error("Could not connect to MySQL Database!");
        if (!mysql_select_db($hawkConfig["dbDbase"], $con))
            return error(mysql_error());
        mysql_query("SET NAMES UTF8");
        function handleError($errno, $errstr, $errfile, $errline, array $errcontext) {
            // error was suppressed with the @-operator
            if (0 === error_reporting()) return false;
            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        }
    ?>

    Aditional info about database:

    MySQL

        Server: localhost via TCP/IP
        Server version: 5.1.56-community
        Protocol version: 10
        User: 1359@localhost
        MySQL charset: UTF-8 Unicode (utf8)

    Web server

        Microsoft-IIS/7.5
        MySQL client version: 5.0.51a
        PHP extension: mysql Documentation

        Version information: 3.4.3, latest stable version: 3.4.10

  • _ForgeUser7498523 added the tags New Defect Feb 17, 2012
  • _ForgeUser7498523 edited description Feb 17, 2012

To post a comment, please login or register a new account.