我已经创建了名为My DB用户名的MySQL数据库,密码是但是当我运行时,下面显示错误消息。resume_managerrootpasswordphp artisan migrate Illuminate\Database\QueryException : SQLSTATE[HY000] [1049] Unknown database 'resume_manager' (SQL: select * from information_schema.tables where table_schema = resume_manager and table_name = migrations) at /home/geralt/Music/resume-manager/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::("SQLSTATE[HY000] [1049] Unknown database 'resume_manager'") /home/geralt/Music/resume-manager/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=resume_manager", "root", "password", []) /home/geralt/Music/resume-manager/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 Please use the argument -v to see more details.我在Xampp上运行MySQL。我已经检查了我的.cnf文件端口设置为默认值,我不知道发生了什么。顺便说一句,我正在使用.我还运行了所有关于3306Linux Mintcache php artisan cache:clear php artisan route:cache php artisan config:clear php artisan view:clear这是我的文件设置:.envAPP_NAME=LaravelAPP_ENV=localAPP_KEY=APP_DEBUG=trueAPP_URL=http://localhostLOG_CHANNEL=stackDB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=resume_managerDB_USERNAME=rootDB_PASSWORD=passwordBROADCAST_DRIVER=logCACHE_DRIVER=fileSESSION_DRIVER=fileSESSION_LIFETIME=120QUEUE_DRIVER=sync
4 回答
互换的青春
TA贡献1797条经验 获得超6个赞
从错误中可以确定您的端口,用户名和密码都没有问题,它们都是正确的...所以只是仔细检查是否存在;resume_manager
简单地转到您的mysql控制台并创建一个空数据库
mysql> CREATE DATABASE resume_manager;
或
你也使用phpmyadmin做同样的事情...
如果数据库已经存在,它将给出错误,否则将创建新的所需数据库...(您的旧数据库名称中可能存在一些拼写错误问题)
慕侠2389804
TA贡献1719条经验 获得超6个赞
每当我们更改 和 in 文件时,我们都需要清除缓存:DB_DATABASEDB_USERNAMEDB_PASSWORD.envphp artisan config:cache
运行迁移工匠命令后:php artisan migrate
- 4 回答
- 0 关注
- 209 浏览
添加回答
举报
0/150
提交
取消
