راکت

ارور هنگام migrateکردن

4 پاسخ

@ali.bayat
@hosseinshirinegad98
هنگامی که میخوام مایگرت کنم این ارور رو میده دیتابیس رو هم کانفیک کردم

  Illuminate\Database\QueryException 
  could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675| 
      +34 vendor frames 
  35  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
ftp
ftp
@ftp
ثبت پرسش جدید

پاسخ‌ها

4
رایموند
رایموند
@Raymond

تخصص: مختصص وردپرس - برنامه نویس لاراول

درود...
برای لینوکس:

sudo apt install php-mysql

برای ویندوز (فایل php.ini زمپ ) :

extension=php_pdo_mysql.dll

; رو حذف کنید.
دستورات زیر نیز وارد کنید:

php artisan cache:clear
php artisan config:clear
php artisan config:cache
ftp
ftp
@ftp

تخصص: ساده

@endworld
این مشکل حل شد اما وقتی تست مینویسم این ارور رو میده(چون میخوام تست با دیتابیس ارتباط داشته باشه).

Error: Call to a member function connection() on null

کدم اینه

$user=new User();
        $user->name="masoud";
        $user->email="netwons@gmail.com";
        $user->password="password";
        $search= User::where('name','masoud')->first();
        $this->assertNotNull($search);

شاید پاسخ شما همین‌جا باشد

علی بیات
علی بیات
@ali.bayat

تخصص: توسعه دهنده ارشد وب

اول User رو save کن


$user=new User();
    $user->name="masoud";
    $user->email="netwons@gmail.com";
    $user->password="password";
    $user->save();

    $search= User::where('name','masoud')->first();
    $this->assertNotNull($search);
ftp
ftp
@ftp

تخصص: ساده

@ali.bayat
@endworld
سیو کردم نشد باز این مشکل رو داره
دوستان کسی نظری نداره

برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام