vessel: Unable to use mysql
Description
I freshly installed docker and Vessel on my working station. But when trying to migrate my database, I get an error :
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
And when running
# Log into mysql
./vessel mysql
I get this message : ERROR: No container found for mysql_1
Thanks for your help !
OS
My OS is:
- MacOS [Mojave]
- Linux
- Windows
Docker
The output of docker version:
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:39 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:06 2019
OS/Arch: linux/amd64
Experimental: false
The output of docker-compose version:
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h 27 Mar 2018
The output of docker image ls:
REPOSITORY TAG IMAGE ID CREATED SIZE
vessel/node latest 3e98f69e6c95 About an hour ago 928MB
vessel/app latest cf10e96ea585 About an hour ago 355MB
node latest b074182f4154 6 hours ago 906MB
mysql 5.7 a1aa4f76fab9 15 hours ago 373MB
redis alpine 72e76053ebb7 3 weeks ago 50.9MB
ubuntu 18.04 7698f282e524 3 weeks ago 69.9MB
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
hi I have the same problem my exits are the following $ ./vessel start Creating network “my-app_vessel” with driver “bridge” Creating my-app_redis_1 … done Creating my-app_node_1 … done Creating my-app_mysql_1 … done Creating my-app_app_1 … done
./vessel ps Name Command State Ports
my-app_app_1 start-container Up 0.0.0.0:80->80/tcp,:::80->8 0/tcp
my-app_mysql_1 docker-entrypoint.sh mysqld Exit 1
my-app_node_1 docker-entrypoint.sh node Exit 0
my-app_redis_1 docker-entrypoint.sh redis Up 6379/tcp
./vessel logs mysql Attaching to my-app_mysql_1 mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started. mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’ mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started. mysql_1 | 2021-06-03 15:35:41+00:00 [ERROR] [Entrypoint]: MYSQL_USER=“root”, MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user mysql_1 | Remove MYSQL_USER=“root” and use one of the following to control the root user password: mysql_1 | - MYSQL_ROOT_PASSWORD mysql_1 | - MYSQL_ALLOW_EMPTY_PASSWORD mysql_1 | - MYSQL_RANDOM_ROOT_PASSWORD
and the passwords are empty
haha, no problem! I’ve done it myself plenty of times 😄
Glad you caught that!
On Thu, Mar 5, 2020 at 08:01 madsem notifications@github.com wrote:
Hey thanks for the quick reply!
First time when I updated to the latest vessel, I’ve follwed these steps: https://vessel.shippingdocker.com/docs/updating-resetting/
Here is what I did now (And realized eloquent queries actually still don’t work and throw the
php_network_getaddresseserror, but runningvessel art migrateworks!!!):I’m running all artisan commands through vessel
edit actually scratch that, my bad, I’ve used the cli history, and because I am also using Vapor, it was actually using php artisan. sorry!!! 🗡
Maybe because I was using Laravel vapor, the whole issue was indeed user error because I got confused, I will report back when I tested Mysql 8 without password again.
Gotcha! I’ll make a note of that to improve the docs there. Those are both a result of how the MySQL container expects to have settings set when it’s created the first time and setting passwords.
Ah, I think I see the issue - Use another user other than “root” in your .env file.
In your case, run “./vessel down -v” (or follow the docs on resetting Vessel) before restarting vessel with the updated .env file.
The key there is deleting the volumes (the mysql data) so it re-creates the new users based on the updated .env file when you start vessel back up. MySQL only creates the users the first time its spun up and sees theres no data initialized yet.
On Wed, Jun 12, 2019 at 09:04 Thomas Lété notifications@github.com wrote: