در نسخه 8 مای اس کیو ال ما شاهد تغییرات اساسی در ساختار داده ای بانک اطلاعاتی هستیم
اگر شما هم تمایل دارید از این ورژن در لاراول و استفاده کنید شاید موقع کانکت شدن به دیتابیس به ارورهایی برخورد کنید که با اجرای دستور زیر میتونید مایگریشن های خودتونو براحتی روی دیتابیس اجرا کنید و ارورهارو مرتفع کنید.
خطایی که شما بهش برخرود میکنید به شکل زیر هستش :
IlluminateDatabaseQueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = laravel_tut and table_name = migrations)
at /Users/home/Projects/laravel_tut/vendor/laravel/framework/src/Illuminate/Database/Coection.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::("PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]")
/Users/home/Projects/laravel_tut/vendor/laravel/framework/src/Illuminate/Database/Coectors/Coector.php:70
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=laravel_tut", "root", "fdgkadgaf9g7ayaig9fgy9ad8fgu9adfg9adg", [])
/Users/home/Projects/laravel_tut/vendor/laravel/framework/src/Illuminate/Database/Coectors/Coector.php:70
دلیل اش اینه که لاراول یا بهتر بگم php از caching_sha2_password
چیزی نمیفهمه پس باید پسورد ورود به دیتابیس رو به شکل زیر معرفی کنید :
ALTER USER 'yourusername'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'new_password'
پس کافیه فقط این اسکریپت رو در دیتابیس تون اجرا کنید و مشکل برطرف بشه و لاراول براحتی به دیتابیس متصل شه
موفق و موید باشید.
ارادتمند مهدی حسامی
برچسب:
نویسنده: آروین دادخواه