I found problem when i want to migrating in Laravel, the error said
[Illuminate\Database\QueryException] could not find driver (SQL: select * from information_schema.tables where table_schema = belajarlaravel and table_name = migrations
i searched the solution, but almost all of forum have a problem with PDOException, which means they have to install php-mysql (for connecting between php and mysql) and set up php.ini. But my php-mysql already installed so what i have to do is set up my php.ini. Here what i did :
1. Go to /opt/lampp/etc/
2. edit php.ini using sudo gedit php.ini
3. find extension=php_pdo_mysql.dll, remove the semicolon and save
4. Restart the web server
When i tried to migrating again with php artisan migrate, i found new error
[Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = belajarlaravel and table_name = migrations and table_type = 'BASE TABLE')
What i did is add DB_SOCKET=/opt/lampp/var/mysql/mysql.sock in .env (change the socket location by your mysql.sock location). Now it works well!


Komentar
Posting Komentar