Can't connect to MYSQL Database Error
- Effec7
- Member | 1
Heyo Guys,
I would need your help with setting up the database connection. I followed the guide on your site, set the config.local.neon and homepagepresenter.php exactly like in the tutorial, yet, I get the error:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
<?php
namespace App\Presenters;
use Nette;
class HomepagePresenter extends Nette\Application\UI\Presenter
{
private $database;
public function __construct(Nette\Database\Context $database)
{
$this->database = $database;
}
public function renderDefault()
{
$this->template->posts = $this->database->table('posts')
->order('created_at DESC')
->limit(5);
}
// ...
}
?>
Do you know is could be a problem?
Many thanks,
Daniel B.
- David Matějka
- Moderator | 6445
I assume you are using mysql >= 8.0.4? if so, it is possibly related to this authentication change . there are many discussions on stackoverflow or gh and other sites, which might help you. e.g. this one: https://github.com/…/issues/1392