简体   繁体   English

PDO例外:SQLSTATE [HY000] [2006] MySQL服务器已经消失了xampp

[英]PDO Exception:SQLSTATE[HY000] [2006] MySQL server has gone away with xampp

I'm trying to connect to the database and fetching some records but I'm getting error: Error i'm getting 我正在尝试连接到数据库并获取一些记录,但我收到错误: 错误我得到了

I'm using Slim PHP framework and slim-twig to render views so my code for the connection file is: 我正在使用Slim PHP框架和slim-twig来渲染视图,因此我的连接文件代码是:

<?php

use Payment\App;
use Illuminate\Database\Capsule\Manager as Capsule;

session_start();

require __DIR__ . '/../vendor/autoload.php';

$app = new App;

$capsule = new Capsule;

$capsule->addConnection([
  'driver' => 'mysql',
  'host' => 'localhost:8080',
  'database' => 'payment',
  'username' => 'root',
  'password' => '',
  'charset' => 'utf8',
  'collation' => 'utf8_unicode_ci',
  'prefix' => ''
]);

$capsule->setAsGlobal();
$capsule->bootEloquent();
require __DIR__ . '/../app/routes.php';

?>

I had also configured my php.ini file properties like max_execution_time & max_allowed_packets but it didn't work and i had also checked that no loop is causing this problem because it takes approx 3 min to show me this error,in this 3 min the it loads.so please anyone can tell me where i'm doing in my code? 我还配置了我的php.ini文件属性,如max_execution_timemax_allowed_packets但它没有工作,我还检查了没有循环导致这个问题,因为它需要大约3分钟来显示这个错误,在这3分钟它loads.so请有人能告诉我我的代码在哪里吗?

Probably caused by your packets. 可能是由您的数据包引起的。 The following settings should help: Run this in your MySQL terminal. 以下设置应该有所帮助:在MySQL终端中运行它。

 set global max_allowed_packet=104857600

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 Laravel 连接到 XAMPP MySQL (MariaDB) 数据库 SQLSTATE[HY000] [2006] MySQL 服务器已经消失 - Connecting Laravel to XAMPP MySQL (MariaDB) database SQLSTATE[HY000] [2006] MySQL server has gone away SQLSTATE [HY000]:常规错误:2006 MySQL服务器已消失,无法创建临时表 - SQLSTATE[HY000]: General error: 2006 MySQL server has gone away creating temporary table Symfony 3 : SQLSTATE[HY000] [2006] MySQL 服务器在更新模式期间消失了 - Symfony 3 : SQLSTATE[HY000] [2006] MySQL server has gone away during update schema 尝试连接时出现“ SQLSTATE [HY000] [2006] MySQL服务器已消失” - I am getting “SQLSTATE[HY000] [2006] MySQL server has gone away” when attempting to connect Doctrine\\DBAL\\Driver\\PDOException SQLSTATE[HY000] [2006] MySQL 服务器已经消失 - Doctrine\DBAL\Driver\PDOException SQLSTATE[HY000] [2006] MySQL server has gone away HY000 2006 MySQL 服务器不见了 - HY000 2006 MySQL server has gone away Piwik升级到MySQL 5.7+ SQLSTATE [HY000]:常规错误:2006 MySQL服务器已消失-由插件操作引起 - Piwik upgrading to MySQL 5.7+ SQLSTATE[HY000]: General error: 2006 MySQL server has gone away - caused by plugin Actions mysqli_real_connect():(HY000 / 2006):MySQL服务器已消失 - mysqli_real_connect(): (HY000/2006): MySQL server has gone away mysqli_connect(): (HY000/2006): MySQL 服务器已经消失 - mysqli_connect(): (HY000/2006): MySQL server has gone away 警告:mysqli_connect(): (HY000/2006): MySQL 服务器已经消失 - Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM