susanBuck / e15-spring22

0 stars 0 forks source link

Week 8 - Laravel Database connection driver issue #43

Closed mgarimelHES closed 2 years ago

mgarimelHES commented 2 years ago

Hi,

I am not sure if anyone is facing this issue, I am following the lecture notes (part-5) for database set up and ran into the issue in 'practice-3'

  1. Changes to env

image

  1. Changes to database and user 'hes' is able to connect from CLI

image

  1. Changes to PracticeController.php are done

image

  1. It is failing with the following error -

image

susanBuck commented 2 years ago

@mgarimelHES -

Try running the following command, swapping 8.x with whatever version major/minor version you see when you run php --version:

> sudo apt-get install php8.x-mysql
mgarimelHES commented 2 years ago

I am getting the following error after running the above command -

image

susanBuck commented 2 years ago

Hi @mgarimelHES - You have to swap 8.x with whatever major/minor version you see when you run php --version.

For example, if you see something like version 8.1.3 when you run php --version, the command would be:

> sudo apt-get install php8.1-mysql

If it's some version of 8.0.* the command would look like this:

> sudo apt-get install php8.0-mysql
susanBuck commented 2 years ago

Please run just the following (8.0 vs 8.0.16):

> sudo apt-get install php8.0-mysql
mgarimelHES commented 2 years ago

Thanks, this sudo apt-get install php8.0-mysql statement resolved my issue.

Appreciate your help

susanBuck commented 2 years ago

I'm going to re-open this issue just in case other students face this problem this week. Thanks for posting, @mgarimelHES.