0

I installed laravel homestead. I have done it before. It went great in the past. But now its being very hard on me. I setup it on Windows and set the .env file to say this:

DB_CONNECTION=mysql
DB_HOST=192.168.10.10
DB_PORT=3306
DB_DATABASE=aff
DB_USERNAME=homestead
DB_PASSWORD=secret

But after doing that and running

php artisan migrate

it gives me this:

   Illuminate\Database\QueryException  : could not find driver (SQL: select * fr
om information_schema.tables where table_schema = aff and table_name = migration
s)

  at C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate\
Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll
 format the error
    661|         // message to include the bindings with SQL, which will make th
is exception a
    662|         // lot more helpful to the developer instead of just the databa
se's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("could not find driver")
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\Connector.php:68

  2   PDO::__construct("mysql:host=192.168.10.10;port=3306;dbname=aff", "homeste
ad", "secret", [])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\Connector.php:68

  Please use the argument -v to see more details.

And when i try to connect to the database in PHPStorm like i have in the past, i get this error message:

Connection to aff@192.168.10.10 failed.
[S1009] The connection property 'zeroDateTimeBehavior' acceptable values are: 'CONVERT_TO_NULL', 'EXCEPTION' or 'ROUND'. The value 'convertToNull' is not acceptable.

Can someone please explain to me why this is happening? Yes, aff is a database. I have no issues logging in via adminer on my server and i am just so confused on why this isn't working. I have to use 192.168.10.10 because its the ip of the virtual box. I used localhost as well and it still did not work before someone comments that haha. Any suggestions? Any requests for more information? I am in a great need of help! :D

UPDATE: When i run php artisan migrate -v this is what i get:

   Illuminate\Database\QueryException  : could not find driver (SQL: select * fr
om information_schema.tables where table_schema = aff and table_name = migration
s)

  at C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate\
Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll
 format the error
    661|         // message to include the bindings with SQL, which will make th
is exception a
    662|         // lot more helpful to the developer instead of just the databa
se's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("could not find driver")
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\Connector.php:68

  2   PDO::__construct("mysql:host=192.168.10.10;port=3306;dbname=aff", "homeste
ad", "secret", [])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\Connector.php:68

  3   Illuminate\Database\Connectors\Connector::createPdoConnection("mysql:host=
192.168.10.10;port=3306;dbname=aff", "homestead", "secret", [])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\Connector.php:44

  4   Illuminate\Database\Connectors\Connector::createConnection("mysql:host=192
.168.10.10;port=3306;dbname=aff", [])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\MySqlConnector.php:24

  5   Illuminate\Database\Connectors\MySqlConnector::connect()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connectors\ConnectionFactory.php:183

  6   Illuminate\Database\Connectors\ConnectionFactory::Illuminate\Database\Conn
ectors\{closure}()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:915

  7   call_user_func(Object(Closure))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:915

  8   Illuminate\Database\Connection::getPdo()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:940

  9   Illuminate\Database\Connection::getReadPdo()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:399

  10  Illuminate\Database\Connection::getPdoForSelect()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:325

  11  Illuminate\Database\Connection::Illuminate\Database\{closure}("select * fr
om information_schema.tables where table_schema = ? and table_name = ?")
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:657

  12  Illuminate\Database\Connection::runQueryCallback("select * from informatio
n_schema.tables where table_schema = ? and table_name = ?", Object(Closure))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:624

  13  Illuminate\Database\Connection::run("select * from information_schema.tabl
es where table_schema = ? and table_name = ?", Object(Closure))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Connection.php:333

  14  Illuminate\Database\Connection::select("select * from information_schema.t
ables where table_schema = ? and table_name = ?")
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Schema\MySqlBuilder.php:18

  15  Illuminate\Database\Schema\MySqlBuilder::hasTable("migrations")
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Migrations\DatabaseMigrationRepository.php:169

  16  Illuminate\Database\Migrations\DatabaseMigrationRepository::repositoryExis
ts()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Migrations\Migrator.php:545

  17  Illuminate\Database\Migrations\Migrator::repositoryExists()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Console\Migrations\MigrateCommand.php:97

  18  Illuminate\Database\Console\Migrations\MigrateCommand::prepareDatabase()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Database\Console\Migrations\MigrateCommand.php:63

  19  Illuminate\Database\Console\Migrations\MigrateCommand::handle()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Container\BoundMethod.php:29

  20  call_user_func_array([])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Container\BoundMethod.php:29

  21  Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Container\BoundMethod.php:87

  22  Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Founda
tion\Application), Object(Closure))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Container\BoundMethod.php:31

  23  Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Applic
ation), [])
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Container\Container.php:564

  24  Illuminate\Container\Container::call()
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Console\Command.php:183

  25  Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input
\ArgvInput), Object(Illuminate\Console\OutputStyle))
      C:\Users\jarro\Documents\sites\aff\vendor\symfony\console\Command\Command.
php:252

  26  Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Co
nsole\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Console\Command.php:170

  27  Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\Arg
vInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\vendor\symfony\console\Application.php:
865

  28  Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Data
base\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\
ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\vendor\symfony\console\Application.php:
241

  29  Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Cons
ole\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\vendor\symfony\console\Application.php:
143

  30  Symfony\Component\Console\Application::run(Object(Symfony\Component\Consol
e\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Console\Application.php:88

  31  Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input
\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\vendor\laravel\framework\src\Illuminate
\Foundation\Console\Kernel.php:122

  32  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Cons
ole\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      C:\Users\jarro\Documents\sites\aff\artisan:37
  • Do you have the mysql-client installed and the php-mysql extension installed? – Zach Abrams Apr 27 '18 at 05:26
  • Its Laravel homestead. MySQL and all the proper extensions for Laravel is pre-installed in the package. –  Apr 27 '18 at 05:28
  • https://stackoverflow.com/questions/42909397/laravel-5-4-on-php-7-0-pdo-exception-could-not-find-driver-mysqlc – Aljay Apr 27 '18 at 05:29
  • @jay - if that link where to help me.. i would have another issue as to why my phpstorm won't connect since it doesn't use any command line on my computer to connect to mysql. It uses its built in drivers. –  Apr 27 '18 at 05:33
  • Usually yes, but the PDOException::("could not find driver") is usually indicative of a mysql extension not being installed. Have you run a composer update or composer install? – Zach Abrams Apr 27 '18 at 05:37
  • Let me go re-install everything. The "could not find driver" does sound like something is missing. But i would have no way of knowing any of this. I am very new to Laravel. I barely know how to do a route file. Just dipping in. Will get back and see if re-setting works. –  Apr 27 '18 at 05:39

0 Answers0