The server requested authentication method unknown to the client

The server requested authentication method unknown to the client

alexandr.yulalexandr.yul Posts: 3Questions: 2Answers: 0

Using DataTables and Editor on my localhost works perfectly. However when I upload everything to my host server and try to view a table, the following error appears:

Datatables warning: table id = table - An error occured while connecting to the database 'dbname'. The error reported by the server was: SQLSTATE[HY000][2054] The server requested authentication method unknown to the client

A Google search talks about old-password, but accessing the database without DataTables works.

Localhost:
PHP: 5.6.25
MySQL: 5.7.14

Server:
PHP: 5.6.29
MySQL: 5.6.32

config.php:
$sql_details = array(
"type" => "Mysql", // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite" or "Oracle"
"user" => "username", // Database user name
"pass" => "password", // Database password
"host" => "localhost", // Database host
"port" => "", // Database connection port (can be left empty for default)
"db" => "dbname", // Database name
"dsn" => "charset=utf8" // PHP DSN extra information. Set as charset=utf8 if you are using MySQL
);

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,121Questions: 1Answers: 10,397 Site admin
    Answer ✓

    accessing the database without DataTables works.

    Using PDO? Can you show me that code please?

    Thanks,
    Allan

  • alexandr.yulalexandr.yul Posts: 3Questions: 2Answers: 0

    I solved this issue by creating a new database and database user, and copying all tables from the old database to the new database.

This discussion has been closed.