Closed al77ex1 closed 6 years ago
Hi @al77ex1 ,
There seems to be a problem with MySql 8.0 forcing new password formats... More info here
Try changing mysql version in docker-compose.yml
from
mysql:8.0
to
mysql:5.6
That should make it work, as MySql 5.6 is a stable version.
Cheers, Joey
Try changing mysql version in docker-compose.yml from
mysql:8.0
tomysql:5.6
now in the console:
!
! [CAUTION] This operation should not be executed in a production environment!
!
Creating database schema...
2018-03-25T15:03:18+00:00 [error] Error thrown while running command "'doc:sch:crea'". Message: "Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known' while executing DDL: CREATE TABLE post (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, last_name VARCHAR(128) NOT NULL, phone VARCHAR(32) NOT NULL, profession VARCHAR(32) NOT NULL, age NUMERIC(10, 0) DEFAULT NULL, salary NUMERIC(10, 0) DEFAULT NULL, notice LONGTEXT DEFAULT NULL, created DATETIME DEFAULT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"
In ToolsException.php line 34:
Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known' while executing DDL: CREATE
TABLE post (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, last_name VARCHAR(128) NOT NULL, phone VARCHAR(32) NOT NULL, profession VARCHAR(32) NOT NULL, age NUMERIC(10, 0) D
EFAULT NULL, salary NUMERIC(10, 0) DEFAULT NULL, notice LONGTEXT DEFAULT NULL, created DATETIME DEFAULT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
In AbstractMySQLDriver.php line 108:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
In PDOConnection.php line 47:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
In PDOConnection.php line 43:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
In PDOConnection.php line 43:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known
Hi again @al77ex1 ,
It seems as if it can't connect to the database. Have you updated the .env file with the parameters from the mysql image?
It works now!
Thank you very much!
Where is docker-compose.yml located?
It's in the project root.
Bonjour à tous,
je me permet de poster ce commentaire pour donner la solution que j'ai trouvé à cette même erreur que j'ai rencontré aujourd'hui.
Il s'avère que mon problème se trouvait au niveau du fichier .env à la ligne suivante :
DATABASE_URL="mysql://db_user:password@127.0.0.1:3306/dbname?serverVersion=5.7"
Afin de créer une base de donnée en symfony, il est primordial d'adapter cette ligne à votre configuration. Vous devez remplacer db_user par root, password par root pour ceux pour lesquels le mot de passe est root (pour ma part par exemple) ou sinon ne rien mettre, pour certain serveur local il n'a pas de mot de passe. Ensuite à la place de dbname, vous devez mettre le nom que vous voulez donner à votre futur base. MAIS CE N'EST PAS FINI !! Si vous vous contentez seulement de ces modifications, vous rencontrerez la même erreur ou pas ! Pour ma part, j'ai rencontré cette erreur, car je devais aussi changer le numéro de port, qui est initialement 3306, sauf pour ceux qui utilise MAMP (sur mac), le port qu'utilise MAMP pour mysql est 8889. Donc en remplaçant 3306 par 8889 cela fonctionne :).
/**
@ORM\Entity(repositoryClass="App\Repository\PostRepository") */ class Post { /**
/**
/**
/**
/**
/**
/**
/**
/**
/**
!
! [CAUTION] This operation should not be executed in a production environment!
!
Creating database schema...
2018-03-24T19:52:41+00:00 [error] Error thrown while running command "'doc:sch:crea'". Message: "Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client' while executing DDL: CREATE TABLE post (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, last_name VARCHAR(128) NOT NULL, phone VARCHAR(32) NOT NULL, profession VARCHAR(32) NOT NULL, age NUMERIC(10, 0) DEFAULT NULL, salary NUMERIC(10, 0) DEFAULT NULL, notice LONGTEXT DEFAULT NULL, created DATETIME DEFAULT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB"
In ToolsException.php line 34:
Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client' while executing DDL: CREATE TABLE
post (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, last_name VARCHAR(128) NOT NULL, phone VARCHAR(32) NOT NULL, profession VARCHAR(32) NOT NULL, age NUMERIC(10, 0) DEFAULT
NULL, salary NUMERIC(10, 0) DEFAULT NULL, notice LONGTEXT DEFAULT NULL, created DATETIME DEFAULT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLAT
E utf8mb4_unicode_ci ENGINE = InnoDB
In AbstractMySQLDriver.php line 121:
An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
In PDOConnection.php line 47:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
In PDOConnection.php line 43:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
In PDOConnection.php line 43:
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]