swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

Swoft\Log\Error:log(30) Run process for process pool fail(Pool error is Create con nection error(Dsn(mysql:dbname=test;host=127.0.0.1) can not to connected!) #1497

Closed slushpuppy closed 1 year ago

slushpuppy commented 1 year ago
Q A
Bug report? no
Feature request? no

PHP: 8.2.5, Swoft: 2.0.11, Swoole: 5.0.2

| Runtime environment | Win11 debian buster wsl

Details

Describe what you are trying to achieve and what goes wrong.

I am trying to test the process component of swoft, however it is also trying to connect to an mysql db. May I know what the mysql db is for and if it is possible to disable that functionality?

2023/04/20-22:07:16 [INFO] Swoft\Tcp\Server\Listener\AppInitCompleteListener:handle(45) Tcp server route registered(routes 4)
2023/04/20-22:07:16 [INFO] Swoft\Error\Listener\AppInitCompleteListener:handle(42) Error manager init completed(4 type, 5 handler, 5 exception)
2023/04/20-22:07:16 [INFO] Swoft\Processor\ConsoleProcessor:handle(44) Console command route registered (group 15, command 47)
2023/04/20-22:07:16 [INFO] App\Process\Worker1Process:run(35) worker-0
2023/04/20-22:07:16 [ERROR] Swoft\Log\Error:log(30) Run process for process pool fail(Pool error is Create connection error(Dsn(mysql:dbname=test;host=127.0.0.1) can no
t to connected!) file(/home/vm/test_prog/vendor/swoft/db/src/Connector/MySqlConnector.php) line (41) file=/home/vm/test_prog/vendor/swoft/connection-pool/src/AbstractPool.php line=265 /home/vm/test_prog/vendor/swoft/db/src/DB.php 81)!

Provide minimal script to reproduce the issue

composer create-project swoft/swoft test_prog
cd test_prog
php bin/swoft process:start
slushpuppy commented 1 year ago

turns out one of the sample task was accessing database