Support the ongoing development of Laravel.io →
Installation Configuration Database
Last updated 2 years ago.
0

Maybe your host is not install pdo extension yet.

Use "yum install php-pdo" and "yum install php-pdo_mysql" command to install it

Then add these line into you php.ini file

extension=pdo.so
extension=pdo_mysql.so

p/s: Sorry for my bad English

0

I can't run this command on ubuntu. Please help me.

0

I try sudo apt-get install php5-gd php5-mysql, but now it show

 [PDOException]                                                               
  SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '  
  /var/run/mysqld/mysqld.sock' (2)             
0

me too i get the same problem

0

same problem occurs here.

0

Do anyone solved this problem?

0

sometimes in you db.config you cannot use locahost as one of the params (host, i believe) so try 127.0.0.1 instead

also in command line do mysql -u username -h localhost -p <enter password>

if this works then use these details in laravel config..

0

I have the same problem, but solved. It's caused because we installed other php binary accidentally and the system uses that instead of LAMPP's php binary.

Here is my solution: Make sure your php binary is point to /opt/lampp/bin/php or /opt/lampp/bin/php-5.x.x by running the command "which php". If your php was pointed to /usr/bin/php, make sure it's a symlink of /opt/lampp/bin/php OR /opt/lampp/bin/php-5.x.x

0

try this:

(in case: installing migrate) /opt/lampp/bin/php artisan migrate:install

you'll not see any erros in case you've updated the .env file to your own configuration

0

I think its your php version problem. upgrade your php version

0

yuomtheara said:

I try sudo apt-get install php5-gd php5-mysql, but now it show

[PDOException]                                                               
 SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '  
 /var/run/mysqld/mysqld.sock' (2)             

You just change hostname from .env or config/database.php from localhost to 127.0.0.1

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

yuomtheara yuomtheara Joined 12 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.