Ububtu 22上与MySQL相关的Laravel启动误差

您所在的位置:网站首页 js插件如何使用快捷键打开 Ububtu 22上与MySQL相关的Laravel启动误差

Ububtu 22上与MySQL相关的Laravel启动误差

2023-04-17 17:14| 来源: 网络整理| 查看: 265

我把Sail添加到了当前的Laravel项目中

composer require laravel/sail --dev php artisan sail:install

但是,当我运行./vendor/bin/sail up时,我会得到MySQL错误:

:~/work/dashboard$ ./vendor/bin/sail up [+] Running 3/3 ⠿ Network dashboard_sail Created 0.1s ⠿ Container dashboard-mysql-1 Created 2.8s ⠿ Container dashboard-laravel.test-1 Created 1.1s Attaching to dashboard-laravel.test-1, dashboard-mysql-1 dashboard-mysql-1 | [Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server dashboard-mysql-1 | [Entrypoint] Starting MySQL 8.0.31-1.2.10-server dashboard-mysql-1 | 2022-10-17T10:10:38.740784Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. dashboard-mysql-1 | 2022-10-17T10:10:38.741647Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1 dashboard-mysql-1 | 2022-10-17T10:10:38.750935Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. dashboard-mysql-1 | 2022-10-17T10:10:38.795221Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. dashboard-mysql-1 | 2022-10-17T10:10:39.287522Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine dashboard-mysql-1 | 2022-10-17T10:10:39.287656Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. dashboard-mysql-1 | 2022-10-17T10:10:39.287668Z 0 [ERROR] [MY-010119] [Server] Aborting dashboard-mysql-1 | 2022-10-17T10:10:39.287971Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL. dashboard-laravel.test-1 | 2022-10-17 10:10:41,882 INFO Set uid to user 0 succeeded dashboard-laravel.test-1 | 2022-10-17 10:10:41,883 INFO supervisord started with pid 1 dashboard-laravel.test-1 | 2022-10-17 10:10:42,885 INFO spawned: 'php' with pid 16 dashboard-laravel.test-1 | dashboard-laravel.test-1 | Illuminate\Database\QueryException dashboard-laravel.test-1 | dashboard-laravel.test-1 | SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = dashboard and table_name = report_errors and table_type = 'BASE TABLE')

.env

DB_CONNECTION=mysql DB_HOST=mysql DB_PORT=3306 DB_DATABASE=dashboard DB_USERNAME=sail DB_PASSWORD=password

当我打开http://localhost的时候,我得到了This site can’t be reached。怎么解决这个问题?

更新

我运行docker ps -a和fount 2容器: onr用于帆,另一个用于MySQL。

f20cf9718056 sail-8.1/app ... dashboard-laravel.test-1 b7007d3a061c mysql/mysql-server:8.0 ... dashboard-mysql-1

我运行docker-compose start,两个容器都在运行。

docker-compose start Starting mysql ... done Starting laravel.test ... done

现在我试着运行./vendor/bin/sail up,但是

SQLSTATE[HY000] [2002] Connection refused

我运行docker ps,但是MySQL容器退出

f20cf9718056 sail-8.1/app "start-container" About an hour ago Up 2 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:5173->5173/tcp, :::5173->5173/tcp, 8000/tcp dashboard-laravel.test-1

MySQL日志

docker logs dashboard-mysql-1 [Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server [Entrypoint] Starting MySQL 8.0.31-1.2.10-server 2022-10-17T14:01:13.615764Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2022-10-17T14:01:13.616826Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1 2022-10-17T14:01:13.627454Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-10-17T14:01:13.832319Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2022-10-17T14:01:14.321686Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2022-10-17T14:01:14.321863Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-10-17T14:01:14.321881Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-10-17T14:01:14.322186Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL. [Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server [Entrypoint] Starting MySQL 8.0.31-1.2.10-server 2022-10-17T14:10:37.311446Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2022-10-17T14:10:37.312494Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1 2022-10-17T14:10:37.331341Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-10-17T14:10:37.442677Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2022-10-17T14:10:37.932648Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2022-10-17T14:10:37.932756Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-10-17T14:10:37.932772Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-10-17T14:10:37.933079Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL. [Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server [Entrypoint] Starting MySQL 8.0.31-1.2.10-server 2022-10-17T14:10:47.381949Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2022-10-17T14:10:47.382974Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1 2022-10-17T14:10:47.389572Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-10-17T14:10:47.411196Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2022-10-17T14:10:47.901979Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2022-10-17T14:10:47.902111Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-10-17T14:10:47.902128Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-10-17T14:10:47.902444Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL. [Entrypoint] MySQL Docker Image 8.0.31-1.2.10-server [Entrypoint] Starting MySQL 8.0.31-1.2.10-server 2022-10-17T15:04:03.773574Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead. 2022-10-17T15:04:03.774621Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 1 2022-10-17T15:04:03.788273Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-10-17T15:04:03.852948Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2022-10-17T15:04:04.341269Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2022-10-17T15:04:04.341410Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2022-10-17T15:04:04.341425Z 0 [ERROR] [MY-010119] [Server] Aborting 2022-10-17T15:04:04.341726Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL.


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3