scotch-io / scotch-box

Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
http://box.scotch.io
2.7k stars 546 forks source link

MySQL connect on Laravel 5.2 #198

Closed marcelo2605 closed 8 years ago

marcelo2605 commented 8 years ago

Can't run artisan migrate. This error appear:

[PDOException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

Here is a partial of my .env file:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=scotchbox
DB_USERNAME=root
DB_PASSWORD=root

Running mysqladmin -u root -p status on SSH return this:

Uptime: 1308 Threads: 3 Questions: 131 Slow queries: 0 Opens: 48 Flush tables: 1 Open tables: 41 Queries per second avg: 0.100

If I change DB_PASSWORD to '', the system cannot find the table:

[PDOException] SQLSTATE[HY000] [1049] Unknown database 'scotchbox'

whatnickcodes commented 8 years ago

The user isn't homestead. It's root.

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

Your configuration is incorrect when connecting to the DB.

marcelo2605 commented 8 years ago

Sorry Nicholas, I post the wrong message. But the error continues.

jordanboston commented 6 years ago

Anyone get this figured out?

marcelo2605 commented 6 years ago

Hi @jordanboston. I believe I was running migrate command in wrong local. As I'm using Vagrant, need to run migrate in VM (vagrant ssh).

jordanboston commented 6 years ago

Ok, thanks. I ended up using Homestead which I don't use normally but works better with Laravel Spark for me.