- Laravel Framework 5.8.35
- MySQL 8.0.17
- Vue 2.5.17
- vue-axios 2.1.5
I read and corrected some articles about authentication methods for MySQL8. By the way, I've made some apps using MySQL and Laravel so far.
// .env DB_CONNECTION = mysql DB_HOST = 127.0.0.1 DB_PORT = 3306 DB_DATABASE = Database name (confirmed) DB_USERNAME = tsubasa (confirmed) DB_PASSWORD = Password (confirmed)
→ This works with Sequel pro, so there seems to be almost no mistake in connection.
>SELECT user, host, plugin FROM mysql.user; + ------------------ + ----------- + ------------------ ----- + | user | host | plugin | + ------------------ + ----------- + ------------------ ----- + | forge |% | caching_sha2_password | | forge1 |% | caching_sha2_password | | tsubasa |% | mysql_native_password | | banana | localhost | caching_sha2_password | mysql.infoschema | localhost | caching_sha2_password | mysql.session | localhost | caching_sha2_password | mysql.sys | localhost | caching_sha2_password | | root | localhost | caching_sha2_password | + ------------------ + ----------- + ------------------ ----- +
I know that it's not good if it's not mysql_native_password, so it is currently only used by tsubasa users.
When you access http://127.0.0.1:8000/api/songs (use Vue, use/api /)
SQLSTATE [HY000]  The server requested authentication method unknown to the client (SQL: select * from
Similarly, even if you have a post relationship, there is no doubt that i am stuck with the same authority.Possible cause
At the bottom of the image,
PDOException: :( "PDO :: __ construct (): The server requested authentication method unknown to the client [caching_sha2_password]") /Users/tsubanana/Downloads/program/utakan/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70 2 PDO :: __ construct ("mysql: host = 127.0.0.1;port = 3306;dbname = laravel", "root", "", ) /Users/tsubanana/Downloads/program/utakan/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
The client [caching_sha2_password] is also written asmysql_native_password
The second point "mysql: host = 127.0.0.1;port = 3306;dbname = laravel", "root" seems to be the default setting, but the user name is set to tsubasa etc. .
I saw Connector.php: 70, which is an error file to fix this, but it seems to be a variable and I can't figure out where to go. .
In other words, there seems to be another .env existence that has been reflected.
I'd be happy if you could teach me somebody.
Answer # 1
.env has been modified so we have to do config: cache but forgot.
In other words, it seems better not to do it outside the production environment. Please check for details.
- i want to change the user authentication method of mysql from chaching_sha2_password to mysql_native_password
- c # - authentication method when creating a gmail client with gmail api
- MySQL 8020 winx64 installation and configuration method graphic tutorials
- MySQL case when using method instance parsing
- MySQL open slow query method and example
- vba display method according to the number of input cells
- Configuration method of MySQL master-slave replication under Windows
- about laravel authentication method
- mysql - grouped according to the contents of the related table
- mysql conditional query and or use method and priority instance analysis
- how to start multiple servers on the same host in mysql8 and perform replication
- Detailed Django configuration JWT authentication method
- MySQL 8020 installation and configuration method graphic tutorials
- Multi-instance configuration method for MySQL database entry
- Win10 mysql 8020 installation and configuration method graphic tutorials
- mysql 8020 installation and configuration method graphic tutorial under docker
- mysql - about data extraction method
- mysql workbench step-by-step connection method
- mysql 8020 installation and configuration method graphic tutorial under window10
- i want to access mysql in aws rds through ssh authentication with mysqlclient in python
- i deployed the laravel + mysql + vue app on heroku, but i get a 500 error in the api part
- php - i don't know how to display an existing database in vue with laravel + mysql + vuejs
- php - non-root pages become not found in laravel nginx
- i want to make an application that can easily search spanish verb conjugation with vuejs + laravel + mysql
- php - laravel can't access local mysql
- php - i want to display the average value of db records passed from laravel to vue
- php - site made with codeigniter and ajax is no longer displayed