我最近将流浪汉的版本更新为2.2.9
。运行命令时,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.
我不确定是什么原因导致了这个问题,过去我已经多次更新了virtualbox,vagrant和homestead软件包,没有问题。
我的机器是OS Catalina 10.15.5
我尝试卸载并重新安装,也尝试安装旧版本的vagrant。一切都会导致上述相同错误。我不确定下一步该怎么做-任何建议都将不胜感激!
编辑谢谢,@ Aminul!这是我得到的输出:
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.
运行:mysql --version
返回:
mysql Ver 15.1 Distrib 10.4.13-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
很明显,这就是说MariaDB尚未启动。我可以研究如何开始。我更好奇-这是宅基地发生的事情吗?还是这是其他原因造成的?通常,我可以vagrant up
,一切都很好。我担心如果我搞砸了,我会为自己的失败做好准备。
编辑2
运行此命令时:
vagrant@homestead:~$ systemctl start mysqld.service
这是提示我的:
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'mariadb.service'.
Authenticating as: vagrant,,, (vagrant)
Password:
我不确定要继续测试的凭据是什么。
附加解决方案
谢谢,Raphy963!我不想回答自己的问题,因此能够找到另一种解决方法,希望对其他人有所帮助。
我正在处理的应用程序尚未投入生产,因此我能够将数据库从MySQL更改为PostgreSQL。
我删除/卸载了virtualbox,vagrant和homestead的所有实例。我还删除了“ VirtualBox VMs”目录。
我重新安装了所有东西,首先是VirtualBox,Vagrant,然后是laravel / homestead。我现在正在运行所有内容的最新版本;使用Laravel文档获取说明。
安装完所有程序后,运行vagrant up
并不会产生错误,但是我仍然无法连接到MySQL。
我将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
我将主机文件更新为:
10.10.10.10 blog.test
最后,使用TablePlus,我可以连接以下内容:
我.env
在Laravel应用程序中的文件如下所示:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=blog
DB_USERNAME=homestead
DB_PASSWORD=secret
现在,我可以使用TablePlus和应用程序进行连接。
希望这对某人有帮助!!
我遇到了同样的问题,花了太多时间试图解决它。我尝试从其GitHub存储库(https://github.com/laravel/homestead)使用新版本的Homestead,该版本声称可解决此确切问题,但无法正常工作。
经过我自己的调查,我意识到Vagrant中用于宅基地工作的脚本(此仓库位于https://github.com/laravel/settler)已更新为“ 10.0.0-beta”。我做了以下操作,将其恢复为“ 9.5.1”。
vagrant box remove laravel/homestead
vagrant box add laravel/homestead --box-version 9.5.1
之后,我通过使用vagrant destroy
和重新创建了实例vagrant up
,MariaDB再次启动并运行。
尽管这可能不是最佳解决方案,但至少我可以使用它,对我来说已经足够了。
希望能有所帮助!
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句