-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
En el fichero config/db.php el host "localhost" deberia cambiarse por 127.0.0.1, ya que algunos sistemas no permiten este "localhost" y da fallo yii con la conexión a mysql. A su vez, se puede especificar el puerto por si la base de datos está dockerizada.
<?php
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;port=3306;dbname=etsiinfbot',
'username' => 'etsiinfbot',
'password' => 'etsiinfbotpass',
'charset' => 'utf8',
];
A su vez, seria interesante añadir, que si está dockerizada la base de datos, hay que cambiar las siguientes lineas, siendo "localhost" por "%", ya que la IP que recibe el docker es diferente. Quedaría así:
CREATE USER 'etsiinfbot'@'%' IDENTIFIED BY 'etsiinfbotpass';
GRANT ALL PRIVILEGES ON etsiinfbot . * TO 'etsiinfbot'@'%';