简体   繁体   English

更新到 2.29 后启动 Laravel Homestead 时出错

[英]Error starting Laravel Homestead after updating to 2.29

I have recently updated my vagrant version to 2.2.9 .我最近将我的 vagrant 版本更新为2.2.9 When running the command, vagrant up I am now getting this error:运行命令时, vagrant up我现在收到此错误:

homestead: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
homestead: Job for mariadb.service failed because the control process exited with error code.
homestead: See "systemctl status mariadb.service" and "journalctl -xe" for details.

I'm not sure what is causing this issue, I've updated the virtualbox, vagrant and the homestead package many times in the past without issue.我不确定是什么导致了这个问题,我过去多次更新了 virtualbox、vagrant 和宅基地 package 没有问题。

My machine is OS Catalina 10.15.5我的机器是 OS Catalina 10.15.5

I have tried uninstalling & re-installing, I've also tried installing an older version of vagrant.我试过卸载和重新安装,我也试过安装旧版本的 vagrant。 Everything results in the same error above.一切都会导致上述相同的错误。 I'm not sure what to do next - any suggestions are greatly appreciated!我不确定下一步该做什么 - 任何建议都非常感谢!

EDIT Thank you, @Aminul: Here is the output I get:编辑谢谢,@Aminul:这是我得到的 output:

Status: "MariaDB server is down"

Jun 20 19:17:53 homestead mysqld[42962]: 2020-06-20 19:17:53 0 [Note] InnoDB: Starting shutdown...
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [ERROR] Plugin 'InnoDB' init function returned error.
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Jun 20 19:17:54 homestead mysqld[42962]: 2020-06-20 19:17:54 0 [ERROR] Aborting
Jun 20 19:17:54 homestead systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 20 19:17:54 homestead systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 20 19:17:54 homestead systemd[1]: Failed to start MariaDB 10.4.13 database server.

Running: mysql --version returns:运行: mysql --version返回:

mysql  Ver 15.1 Distrib 10.4.13-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

So clearly, it's saying that MariaDB is not started.这么清楚,就是说 MariaDB 没有启动。 I can research how to start that.我可以研究如何开始。 I'm more curious though -- is this something that's happened to homestead?不过我更好奇——这是宅基地发生的事情吗? Or is this a result of something else?或者这是其他原因的结果? Normally, I can just vagrant up and everything is good to go.通常情况下,我可以只vagrant up和 go 一切都很好。 I worry that if I mess with things I'm setting myself up for failure down the road.我担心如果我把事情搞砸了,我会让自己在路上失败。

EDIT 2编辑 2

When running this:运行时:

vagrant@homestead:~$ systemctl start mysqld.service

This is what I am prompted with:这就是我的提示:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'mariadb.service'.
Authenticating as: vagrant,,, (vagrant)
Password: 

I'm not sure what the credentials are to keep testing.我不确定继续测试的凭据是什么。

ADDITIONAL SOLUTION附加解决方案

Thank you,Raphy963, I didn't want to answer my own question.谢谢你,Raphy963,我不想回答我自己的问题。 and I was able to find another work-around that hopefully will help someone else.而且我能够找到另一种解决方法,希望能对其他人有所帮助。

The application I am working on is not yet in production, so I was able to change my database from MySQL to PostgreSQL.我正在处理的应用程序尚未投入生产,因此我能够将我的数据库从 MySQL 更改为 PostgreSQL。

I removed/uninstalled all instances of virtualbox, vagrant & homestead.我删除/卸载了 virtualbox、vagrant 和宅基地的所有实例。 I also removed the "VirtualBox VMs" directory.我还删除了“VirtualBox VMs”目录。

I re-installed everything, starting with VirtualBox, Vagrant & then laravel/homestead.我重新安装了所有东西,从 VirtualBox、Vagrant 开始,然后是 laravel/homestead。 I am now running the latest versions of everything;我现在正在运行所有内容的最新版本; using the Laravel documentation for instructions.使用Laravel 文档获取说明。

After everything was installed, running vagrant up did not create errors, however I was still not able to connect to MySQL.安装完所有东西后,运行vagrant up并没有产生错误,但是我仍然无法连接到 MySQL。

I updated my Homestead.yaml file to the following:我将我的Homestead.yaml文件更新为以下内容:

---
ip: "10.10.10.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Users/<username>/Sites
      to: /home/vagrant/sites

sites:    
    - map: blog.test
      to: /home/vagrant/sites/blog/public

databases:
    - blog
    - homestead


features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

I updated my hosts file to this:我将我的主机文件更新为:

10.10.10.10     blog.test

Finally, using TablePlus I was able to connect with the following:最后,使用TablePlus我能够连接以下内容: 在此处输入图像描述

My .env file in my Laravel application looks like this:我的 Laravel 应用程序中的.env文件如下所示:

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=blog
DB_USERNAME=homestead
DB_PASSWORD=secret

I am now able to connect using TablePlus and from my application.我现在可以使用 TablePlus 和我的应用程序进行连接。

Hope this helps someone!!希望这对某人有帮助!

I was having the same issue and spent way too much time trying to fix it.我遇到了同样的问题,花了太多时间试图解决它。 I tried using the new release of Homestead from their GitHub repo ( https://github.com/laravel/homestead ) which claims to fix this exact issue but it didn't work.我尝试使用来自他们的 GitHub 存储库( https://github.com/laravel/homestead )的新版本 Homestead ,它声称可以解决这个确切的问题,但它没有用。

After investigating on my own, I realized the scripts used in Vagrant for homestead to work (This repo over here https://github.com/laravel/settler ) has been updated to "10.0.0-beta".在我自己调查之后,我意识到 Vagrant 中用于宅基地工作的脚本(这个 repo 在这里https://github.com/laravel/settler )已更新为“10.0.0-beta”。 I did the following to put it back to "9.5.1".我做了以下将其放回“9.5.1”。

vagrant box remove laravel/homestead
vagrant box add laravel/homestead --box-version 9.5.1

Afterwards, I remade my instance by using vagrant destroy and vagrant up and MariaDB was up and running once more.之后,我使用vagrant destroyvagrant up重新制作了我的实例,MariaDB 再次启动并运行。

While this might not be the best solution, at least I got it to work which is good enough for me.虽然这可能不是最好的解决方案,但至少我让它工作起来对我来说已经足够好了。

Hope it helped!希望它有所帮助!

You will need to investigate what is the cause.您将需要调查原因。

Login to your instance by runing vagrant ssh and run systemctl status mariadb.service for checking the error log.通过运行vagrant ssh登录到您的实例并运行systemctl status mariadb.service以检查错误日志。

Check what is is the error and reply here if you didn't understand.检查是什么错误,如果您不明白,请在此处回复。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM