1,linux 查询容器 ID:

docker ps

2,进入容器(退出 exec 命令用:[ctrl+D] ,不会终止容器运行。退出 top 命令:ctrl + C)

docker exec -it c39c9d3898c0 /bin/bash

3,查询进程,强制关闭进程

root@test-client:/var/www/html# ps -aux | grep php
root        62  0.0  1.6 150504 16836 pts/4    S+   Nov29   6:25 php artisan queue:work
root       101  0.0  0.0  11120   712 pts/5    S+   08:29   0:00 grep php
root@test-client:/var/www/html# kill -9 62

4,直接进入系统根目录 /var/www/html# cd /website ,迁移数据表

php artisan migrate
Migration table created successfully.

   遇到问题:

    Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

  解决方法:

use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
    Schema::defaultStringLength(191); //字段长
}

 

转载于:https://www.cnblogs.com/xkfeng/p/8066522.html

Logo

更多推荐