Postingan lainnya
Koneksi Laravel ke Mysql tidak bisa ditemukan
Saya sudah memasukan skrip "use Illuminate\Support\Facades\DB;" pada file BlogController.php dan kemudian mengedit file .env sesuai pengaturan mysql saya (dengan password kosong) :
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel53 DB_USERNAME=root DB_PASSWORD=null
Kemudian saya buat database "laravel53" table "users" di mysql-lampp. Lalu saya aktifkan server mysql lampp dan server laravel (artisan serve) lewat terminal bersamaan. dan kemudian menghubungkannya. Saya menyimak intruksi materi Laravel "database dengan query builder". tapi ketika saya running di browser, hasilnya masih error:
Illuminate \ Database \ QueryException could not find driver (SQL: select * from `users`)
Ada kah solusi dari agan2 ?
https://drive.google.com/file/d/1hyvAQ7qQ6cib2o-3gHPbi_S9l62d6kTv/view?usp=sharing https://drive.google.com/file/d/1XpUjIWwk4DaQuKNB4yh5TK8ISsn3PfUA/view?usp=sharing https://drive.google.com/file/d/1sbFuywIvt3II3fB6PBMJy_HpoFlVole_/view?usp=sharing https://drive.google.com/file/d/1VUcfppBGgZHoaZQ-tr9eSAaEmpCoLS8k/view?usp=sharing
6 Jawaban:
Belum. kalau saya lihat tutorial, bang hilman belum melakukan artisan migrate tapi sudah bisa dikoneksikan. tapi kenapa saya gk bisa ya ?
Barusan, saya sudah buat file berisi 'class CreateForumsTable extends Migration' di folder Migrations. Kemudian ketika saya lakukan 'php artisan migrate'. Masalah tetap sama : Illuminate\Database\QueryException : could not find driver.
On Terminal :
omesh@omesh-Aspire-4738:~/bloggy$ php artisan migrate
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = laravel53 and table_name = migrations)
at /home/omesh/bloggy/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 Doctrine\DBAL\Driver\PDOException::("could not find driver") /home/omesh/bloggy/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:50
2 PDOException::("could not find driver") /home/omesh/bloggy/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:46
Please use the argument -v to see more details. omesh@omesh-Aspire-4738:~/bloggy$
Could not find driver. coba cek nama database nya mas...
sudah dapat solusinya mas dari stackoverflow. terimaksih atas responnya :)