• Hi ive created a database at the back end and im trying to get a search function to read through it and return results and after trying for 3 days im now here. i receive this message when i try to connect with the database. im new to WordPress so am finding this rather difficult.
    Failed to connect to MySQL: The server requested authentication method unknown to the client
    any help or suggested pluggin that would work instead is greatly appreciated

    • This topic was modified 5 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • How are you trying to connect to the database, can you share the code? Are you sure the credentials are correct?

    Thread Starter thewhisper

    (@thewhisper)

    <form action=”” method=”post”>
    <input type=”text” name=”search”>
    <input type=”submit” name=”submit” value=”Search”>
    </form>

    <?php
    $search_value=$_POST[“search”];
    $con=new mysqli(“localhost”,”username”,”password”,”Judges_Calendar”);
    if($con->connect_error){
    echo ‘Connection Faild: ‘.$con->connect_error;
    }else{
    $sql=”select * from information WHERE Judge like ‘%$search_value%'”;

    $res=$con->query($sql);

    while($row=$res->fetch_assoc()){
    echo ‘First_name: ‘.$row[“First_Name”];

    }

    }
    ?>

    Connection Faild: Access denied for user ‘username’@’localhost’ to database ‘Judges_Calendar’

    that is the message i receive. im using the username and password found in my gridpane account info. (username and passwords have been changed for this post)
    im not sure if i just dont have permission or something

    // ** MySQL settings – You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( ‘DB_NAME’, ‘dbname’ );

    /** MySQL database username */
    define( ‘DB_USER’, ‘username’ );

    /** MySQL database password */
    define( ‘DB_PASSWORD’, ‘password’ );

    /** MySQL hostname */
    define( ‘DB_HOST’, ‘localhost’ );

    /** Database Charset to use in creating database tables. */
    define( ‘DB_CHARSET’, ‘utf8’ );

    /** The Database Collate type. Don’t change this if in doubt. */
    define( ‘DB_COLLATE’, ” );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database help’ is closed to new replies.