Binaryfolks 2020 Dev Assignment
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Sudipta Das
Posts : 14
Join date : 2020-07-25

Error while connecting with database Empty Error while connecting with database

Mon Jul 27, 2020 5:20 am
Error while connecting with database Screen10
getting this error while connecting with database.(I am following episode 9 from the tutorials).
sujoy98
sujoy98
Posts : 19
Join date : 2020-07-25
Age : 25

Error while connecting with database Empty Driver Not Found.

Mon Jul 27, 2020 8:06 am
Try therse steps,

Solution 1. run
Code:
composer update
Code:
composer require doctrine/dbal
,You might also need to uncomment this (
Code:
;extension=pdo_mysql.so
) from ; in your php.ini file.

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
, and also check your .env file,
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

avatar
Arghya De
Posts : 6
Join date : 2020-07-25

Error while connecting with database Empty 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.

sujoy98 likes this post

avatar
Jeetbasak54@gmail.com
Posts : 18
Join date : 2020-07-25

Error while connecting with database Empty 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 .
Sponsored content

Error while connecting with database Empty Re: Error while connecting with database

Back to top
Permissions in this forum:
You cannot reply to topics in this forum