0

Since this morning every time i try update the schema of my database en symfony thanks to this command : php bin/console doctrine:schema:update --force. I receive 4 errors, you can see the output below :

In AbstractMySQLDriver.php line 126:
An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away  
                                                                                  

In PDOConnection.php line 50:
SQLSTATE[HY000] [2006] MySQL server has gone away  
                                                 

In PDOConnection.php line 46:
SQLSTATE[HY000] [2006] MySQL server has gone away  
                                                 

In PDOConnection.php line 46:
PDO::__construct(): Unexpected server respose while doing caching_sha2 auth: 109 

Since yesterday i changed nothing.

This is my parameter.yml :

parameters:
  database_host: 127.0.0.1
  database_port: 3306
  database_name: theatreP
  database_user: root
  database_password: ~
  mailer_transport: gmail
  mailer_host: 127.0.0.1
  mailer_user: %mon_mail%
  mailer_password: %psw%
  secret: ThisTokenIsNotSoSecretChangeIt`

I also check timeout with SHOW SESSION VARIABLES LIKE '%timeout'; :

+-----------------------------------+----------+ | Variable_name | Value | +-----------------------------------+----------+ | connect_timeout | 10 | | delayed_insert_timeout | 300 | | have_statement_timeout | YES | | innodb_flush_log_at_timeout | 1 | | innodb_lock_wait_timeout | 50 | | innodb_rollback_on_timeout | OFF | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | mysqlx_connect_timeout | 30 | | mysqlx_idle_worker_thread_timeout | 60 | | mysqlx_interactive_timeout | 28800 | | mysqlx_port_open_timeout | 0 | | mysqlx_read_timeout | 30 | | mysqlx_wait_timeout | 28800 | | mysqlx_write_timeout | 60 | | net_read_timeout | 30 | | net_write_timeout | 60 | | rpl_stop_slave_timeout | 31536000 | | slave_net_timeout | 60 | | wait_timeout | 28800 | +-----------------------------------+----------+

I try to change value wait_timeout && interactive_timeout but i did not find the file to modify

I'm on Mac Os : 10.13.6 (High Sierra)


Mysql :8.0.12 for osx10.13 on x86_64 (Homebrew)
Php : 7.1.20
Node : v8.12.0
npm : 6.4.1

Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
MrFireFerid
  • 35
  • 2
  • 9
  • Check this out: https://stackoverflow.com/questions/33250453/how-to-solve-general-error-2006-mysql-server-has-gone-away – Gobbin Sep 18 '18 at 12:06
  • 1
    In `/usr/local/etc/my.cnf` i changed value highest than default or lowest but the error is still there. I even uninstall and install again mysql 4 times today. – MrFireFerid Sep 18 '18 at 12:51

1 Answers1

0

In my case I had to modify the mysql user to be identified with "caching_sha2_password":

CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'user_password';

ALTER USER `db_user`@`localhost` IDENTIFIED WITH caching_sha2_password BY 'user_password';

GRANT ALL PRIVILEGES ON mydatabase.* TO 'db_user'@'localhost';
Tomas
  • 866
  • 16
  • 21