最近试图进入Laravel 5.1。它进展不顺利,有时它甚至不会做最基本的事情。例如:
Sebastians-MacBook-Pro:restaurante STianR$ php artisan migrate
[PDOException]
SQLSTATE[HY000] [1049] Unknown database 'dbname'
但是当我直接访问mysql时:
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>
这甚至意味着什么?我试图让它与MAMP一起运行,可能是因为我有两个不同的sql服务器并且它们正在混合?
这是我的.env文件:
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