0
我试图用我的Laravel项目附上phpMyAdmin的在我的XAMPP服务器,我失败了,我每次做:发生连接phpMyAdmin的在XAMPP与Laravel项目
php artisan migrate
此错误:
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
这是我
.env
文件:DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=''
这是我
database.php
文件:'mysql' => [ 'driver' => 'mysql', 'host' => 'localhost', 'port' => env('DB_PORT', '3306'), 'database' => 'laravel', 'username' => 'root', 'password' => '', 'unix_socket' => '/opt/lampp/var/mysql/mysql.sock', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => null, ],
在您的php.ini文件中更改'mysqli.default_host'指向路径'/ tmp/mysql.sock' –