-
Notifications
You must be signed in to change notification settings - Fork 205
连接不上数据库? #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree 8000 to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
你好,终于找到原因了,/etc/mysql/mysql.conf.d/mysqld.cnf root@76819b92e31a:/var/www/html# php artisan code6:user-add xx@xxxx.com xxxx In Connection.php line 671: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'code6.user' doesn't exist (SQL: select * from In Connection.php line 331: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'code6.user' doesn't exist 看了ISSUE ,这样解决: 启动容器的时候自动创建,如果启动时数据库连接不上则创建失败,可以重新启动一个容器或者在当前容器执行: php artisan migrate 谢谢。 |
启动容器的时候数据库连不上,自动导入数据表失败,可以重新启动一个新的容器,或者在当前容器执行:
|
试过:docker run -d -p 666:80 -e MYSQL_HOST=IP ---这里的IP是宿主机的IP,还是宿主机的docker网关IP 172.17.0.1?
In Connection.php line 671:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from
user
where (email
= xx@xx.com) limit 1)In Connector.php line 70:
SQLSTATE[HY000] [2002] Connection refused
The text was updated successfully, but these errors were encountered: