mysql user OK, fails in Laravel, db:seed
kriptor@LAPTOP-M7QO17H9:/mnt/c/Users/wealt$ mysql -ukriptor3 -psuper250
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Now, when trying db:seed...
php artisan db:seed
Seeding: UserSeeder
Illuminate\Database\QueryException : SQLSTATE[HY000] [1044] Access denied for user 'kriptor3'@'localhost' to database 'listjoe' (SQL: select * from `users`)
at /home/kriptor/projects/listjoe/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 Illuminate\Database\Eloquent\FactoryBuilder::Illuminate\Database\Eloquent\{closure}()
[internal]:0
2 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[HY000] [1044] Access denied for user 'kriptor3'@'localhost' to database 'listjoe'")
/home/kriptor/projects/listjoe/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Please use the argument -v to see more details.
My.env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=listjoe
DB_USERNAME=kriptor3
DB_PASSWORD=super250
Pretty confusing, hard to search for, I haven't found any examples for hours now. Any help is greatly appreciated. SO is telling me to write more so... I created the user in mysql using create user identified by, etc, then granted all privileges, and flush privileges. I think all this is self explanatory, mysql user should be working in laravel. Any ideas?
Well, I finally just rm -rf and git clone it back in and now it's fine. Thanks for your help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.