SQLSTATE[HY000] [2006] MySQL server has gone away while the setup #4233

Closed
opened 2026-02-05 08:18:30 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @pthoelken on GitHub (Sep 24, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I've do exactly all the things what you describe in the page here: https://www.bookstackapp.com/docs/admin/installation/ and from the step "artisan migrate" I got the following error:

In Connection.php line 760:
  SQLSTATE[HY000] [2006] MySQL server has gone away (SQL: select * from information_schema.tables where table_schema = db3 and table_name = migrations and table_type = 'BASE TABLE')

In Connector.php line 70:
  SQLSTATE[HY000] [2006] MySQL server has gone away

Of course the database is available at 3306 and all other instances are working well. Also I've tried with a change of passwords. Without any success.

Exact BookStack Version

v23.08.3

Log Content

n/a

Hosting Environment

KeyHelp Self Hosted Environment, Debian 11 with latest composer and PHP8

Originally created by @pthoelken on GitHub (Sep 24, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I've do exactly all the things what you describe in the page here: https://www.bookstackapp.com/docs/admin/installation/ and from the step "artisan migrate" I got the following error: ``` In Connection.php line 760: SQLSTATE[HY000] [2006] MySQL server has gone away (SQL: select * from information_schema.tables where table_schema = db3 and table_name = migrations and table_type = 'BASE TABLE') In Connector.php line 70: SQLSTATE[HY000] [2006] MySQL server has gone away ``` Of course the database is available at 3306 and all other instances are working well. Also I've tried with a change of passwords. Without any success. ### Exact BookStack Version v23.08.3 ### Log Content n/a ### Hosting Environment KeyHelp Self Hosted Environment, Debian 11 with latest composer and PHP8
OVERLORD added the 🐕 Support label 2026-02-05 08:18:30 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 25, 2023):

Hi @pthoelken,
This is not something I've experienced myself.
Possibly due to the specific way users are created via the control panel used?

Could try following the guidance here:
https://php.watch/articles/PHP-7.4-MySQL-8-server-gone-away-fix

@ssddanbrown commented on GitHub (Sep 25, 2023): Hi @pthoelken, This is not something I've experienced myself. Possibly due to the specific way users are created via the control panel used? Could try following the guidance here: https://php.watch/articles/PHP-7.4-MySQL-8-server-gone-away-fix
Author
Owner

@pthoelken commented on GitHub (Sep 25, 2023):

Hi @ssddanbrown,
Thanks for your quick reply. When I do this form your link I got the following errors:

MariaDB [mysql]> ALTER USER 'user_db3'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'XXX';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'XXX'' at line 1
@pthoelken commented on GitHub (Sep 25, 2023): Hi @ssddanbrown, Thanks for your quick reply. When I do this form your link I got the following errors: ``` MariaDB [mysql]> ALTER USER 'user_db3'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'XXX'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'XXX'' at line 1 ```
Author
Owner

@pthoelken commented on GitHub (Sep 26, 2023):

@ssddanbrown - The problem is not the user account in mysql local. It's a problem by this configuration line which is enabled by default:

MYSQL_ATTR_SSL_CA="/path/to/ca.pem"

When I disable this line, the database will be created successfully. Maybe this line should be disabled by default in the .env.complete? You can close this issue.

@pthoelken commented on GitHub (Sep 26, 2023): @ssddanbrown - The problem is not the user account in mysql local. It's a problem by this configuration line which is enabled by default: `MYSQL_ATTR_SSL_CA="/path/to/ca.pem"` When I disable this line, the database will be created successfully. Maybe this line should be disabled by default in the .env.complete? You can close this issue.
Author
Owner

@ssddanbrown commented on GitHub (Sep 26, 2023):

@pthoelken Thanks for confirming, yeah, please only copy values from .env.example.complete where required.
It's not meant to be used as a basis for a .env file (Hence the warning that the top of the file.)

@ssddanbrown commented on GitHub (Sep 26, 2023): @pthoelken Thanks for confirming, yeah, please only copy values from `.env.example.complete` where required. It's not meant to be used as a basis for a `.env` file (Hence the warning that the top of the file.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4233