Mysql laravel php artisan迁移问题

Mysql laravel php artisan迁移问题,mysql,laravel,ubuntu,pdo,vagrant,Mysql,Laravel,Ubuntu,Pdo,Vagrant,运行此命令时:php artisan migrate我遇到一个错误: Illumb\Database\QueryException:找不到驱动程序(SQL: 从信息_schema.tables中选择*,其中table_schema=loag和 表(名称=迁移) 我已经用ubuntu 18.04和PHP、MySQL 7.2版建立了一个流浪环境。我编辑了php.ini文件,并在web上的100个站点上完成了所有1000件事情。我感到困惑的是,迁移仍然不起作用 composer create-proj

运行此命令时:
php artisan migrate
我遇到一个错误:

Illumb\Database\QueryException:找不到驱动程序(SQL: 从信息_schema.tables中选择*,其中table_schema=loag和 表(名称=迁移)

我已经用ubuntu 18.04和PHP、MySQL 7.2版建立了一个流浪环境。我编辑了php.ini文件,并在web上的100个站点上完成了所有1000件事情。我感到困惑的是,迁移仍然不起作用

composer create-project laravel/laravel projectname
config/database.php

'mysql' => [
            'driver' => 'mysql',
            'host' => '127.0.0.1',//env('DB_HOST', '127.0.0.1'),
            'port' => '3306',//env('DB_PORT', '3306'),
            'database' => 'loag',//env('DB_DATABASE', 'forge'),
            'username' => 'root',//env('DB_USERNAME', 'forge'),
            'password' => 'root',//env('DB_PASSWORD', ''),
            'unix_socket' => '/etc/mysql/mysql.sock',//env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
        ],
.env

APP_NAME="Laendliche Ostbahnen AG"
APP_ENV=local
APP_KEY=base64:SKuPKct0ug16L4DTEvcFD59YuHKf8znDmQrqG973L6w=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=loag
DB_USERNAME=root
DB_PASSWORD=root`
composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
...
在ubuntu上安装:在此处输入代码

# Set environment variable
DEBIAN_FRONTEND=noninteractive

# Update Packages
apt-get update

# Upgrade Packages
apt-get dist-upgrade

# Apache
apt-get install -y apache2

# Enable Apache Mods
a2enmod rewrite

# Install PHP
apt-get install -y php7.2

# PHP Apache Mod
apt-get install -y libapache2-mod-php7.2

# Restart Apache
service apache2 restart

# PHP Mods
apt-get install -y php7.2-xml
apt-get install -y php7.2-common
apt-get install -y php7.2-zip

# PHP-MYSQL lib
apt-get install -y php7.2-mysql
apt-get install -y mysql-server

# Disable old apache vhosts config and enable the new one
#a2dissite 000-default.conf

# Restart Apache
sudo systemctl restart apache2.service
phpmyadmin中的数据库:(受影响的数据库应为loag(loag和laravel为空) 信息模式 拉维尔 泥鳅 mysql 性能模式 phpmyadmin 系统

需要更多吗

执行以下操作时:
php artisan migrate
将生成以下输出:

Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = loag and table_name = migrations)

  at C:\Users\Marco Ris\Desktop\Webdevelopment\loag\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("could not find driver")
      C:\Users\Marco Ris\Desktop\Webdevelopment\loag\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

  2   PDO::__construct("mysql:unix_socket=/etc/mysql/mysql.sock;dbname=loag", "root", "root", [])      C:\Users\Marco Ris\Desktop\Webdevelopment\loag\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70

  Please use the argument -v to see more details

也许这会解决你的问题

sudo apt-get install php7-mysql


相信我,我做了所有的事情;-)你已经在php.ini中启用了pdo_mysql模块了吗?
sudo apt-get install php5-mysql
sudo apt-get install php-mysql