mardi 26 janvier 2016

php artisan can't find existing databases even when they are clearly there

Been trying to get into Laravel 5.1 lately. It's not going well, sometimes it won't even do the most basic things. for example:

Sebastians-MacBook-Pro:restaurante STianR$ php artisan migrate

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

But when I access mysql directly:

Sebastians-MacBook-Pro:restaurante STianR$ mysql -u root -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 166
Server version: 5.6.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database dbname;
ERROR 1007 (HY000): Can't create database 'dbname'; database exists
mysql>

What in the world does this even mean? I'm trying to make it run with MAMP, could it be that somehow I have two diferent sql servers and they are mixing up?

This is my .env file:

APP_ENV=local
APP_DEBUG=true
APP_KEY=[key - not sure if sensitive info]

DB_HOST=localhost
DB_DATABASE=dbname
DB_USERNAME=root
DB_PASSWORD=root

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire