- Sudipta Das
- Posts : 14
Join date : 2020-07-25
Error while connecting with database
Mon Jul 27, 2020 5:20 am
- sujoy98
- Posts : 19
Join date : 2020-07-25
Age : 25
Driver Not Found.
Mon Jul 27, 2020 8:06 am
Try therse steps,
Solution 1. run
Solution 2. It can cause due to cache problem also,
Solution 1. run
- Code:
composer update
- Code:
composer require doctrine/dbal
- Code:
;extension=pdo_mysql.so
Solution 2. It can cause due to cache problem also,
- Code:
php artisan cache:clear
- Code:
php artisan view:clear
- Code:
php artisan route:clear
- Code:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=root
DB_PASSWORD=secret
Sudipta Das and Arghya De like this post
- Arghya De
- Posts : 6
Join date : 2020-07-25
Re: Error while connecting with database
Mon Jul 27, 2020 9:26 am
I have faced same problem, but I solved it by editing the "php.ini" file by uncommenting
";extension =php_pdo_mysql.dll".
If it not present add it in your php.ini file(for my case it was not present) . Save php.ini file and restart MySQL server and php server.
";extension =php_pdo_mysql.dll".
If it not present add it in your php.ini file(for my case it was not present) . Save php.ini file and restart MySQL server and php server.
sujoy98 likes this post
- Jeetbasak54@gmail.com
- Posts : 18
Join date : 2020-07-25
Re: Error while connecting with database
Mon Jul 27, 2020 12:18 pm
1st. Open your MySQL Xaamp server then turn on the 1st 2 option which is Apache and MySQL. Is the row of mysql u can c the port number. Just note it down.
2nd. Go to your project file that u have created and then go to config folder . U can c database.php file. Just open it in your editor.
3rd. Scroll down that database.php file in ur editor and u can see mysql database connection. As there are a no. Of database u have to choose that only mysql. Then in that mysql block u can c the database name , username , password and port no.
4th. In database name give ur database name that u need to create in phpmyadmin. In username use root and password will b blank as it's in local host. And in port no just make sure what u have write down initially ,the same port is there or not. If not just put that port no too over there.
5th. Go to your project folder and open .evn file. Open it in your editor and from line 9 to 14 u can c the mysql details. Just filled it according the database.php file. And ur connection will b done.
6th. Just at the time of table creation use 2 more extra field for created_at and updated-at or else it will give an error. And thats it.. hope it will help you to connect database .
Permissions in this forum:
You cannot reply to topics in this forum