使用react/mysql 连接数据库时,一直报这个错误
Fatal error: Uncaught exception 'RuntimeException' with message 'Can't shift from an empty datastructure' in /data/web/socket/Workerman/vendor/react/mysql/src/Protocal/Parser.php:289
Stack trace:
#0 /data/web/socket/Workerman/vendor/react/mysql/src/Protocal/Parser.php(289): SplQueue->dequeue()
#1 /data/web/socket/Workerman/vendor/react/mysql/src/Protocal/Parser.php(195): React\MySQL\Protocal\Parser->onError()
#2 : React\MySQL\Protocal\Parser->parse('???????#28000ip...', Object(React\Socket\Connection))
#3 /data/web/socket/Workerman/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(65): call_user_func_array(Array, Array)
#4 /data/web/socket/Workerman/vendor/react/stream/src/Stream.php(173): Evenement\EventEmitter->emit('data', Array)
#5 : React\Stream\Stream->handleData(Resource id #964, Object(Workerman\Events\React\LibEventLoop))
#6 /data/web/socket/Workerman/vendor/react/event-loop/src/LibEventLoop.php(335): call_user_func(Array, Resource id #964, Object(Workerman\Event in /data/web/socket/Workerman/vendor/react/mysql/src/Protocal/Parser.php on line 289
把8.8.8.8 换成阿里云内网dns服务器地址。
如果React\Dns不太会用的话,可以用ip来连数据库,不要用域名。