错误:对于mysql,需要类似字节的对象,而不是';str';使用docker compose和laravel sail

错误:对于mysql,需要类似字节的对象,而不是';str';使用docker compose和laravel sail,laravel,docker,docker-compose,laravel-sail,Laravel,Docker,Docker Compose,Laravel Sail,我重新启动了系统,然后使用vendor/bin/sail up命令运行了所有容器,唯一一个无法重新加载的是MySQL。错误如下: ERROR: for mysql a bytes-like object is required, not 'str' Traceback (most recent call last): File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _rai

我重新启动了系统,然后使用
vendor/bin/sail up
命令运行了所有容器,唯一一个无法重新加载的是MySQL。错误如下:

ERROR: for mysql  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.25/containers/afdd1cbf7f45d9b20612bca
f73eef1b0bc1dd631bc6aa3dcfbf630c64e8a3662/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
    container.start()
  File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
    return self.client.start(self.id, **options)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
    self._raise_for_status(res)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'Ports are not available: listen tcp 0.0.0.0:3306: bind: An attempt was made
to access a socket in a way forbidden by its access permissions.'")



我正在ubuntu服务器20.04上运行这个容器。

我不确定为什么没有报告好错误,但最后一行中的最后一个错误看起来像是Windows错误,而不是你在ubuntu上看到的。还有一些建议,但它们是特定于Windows的。