Zend Framework 教程 - 我不断收到 sql 错误 - 未知数据库
我已经按照留言簿教程一步步进行了。他们使用 load.sqlite.sql 创建数据库并加载数据。但我得到:
C:\quickstart> php scripts\load.mysql.php --withdata
AN ERROR HAS OCCURED:
SQLSTATE[42000] [1049] Unknown database 'c:\quickstart\data\db\guestbook-dev.db'
My application\configs\application.ini looks like:
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
resources.view[] =
resources.db.adapter = "PDO_MYSQL"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.host = "localhost"
resources.db.params.dbname = "C:\quickstart\data\db\guestbook-dev.db"
I have following the guestbook tutorial step by step. They use a load.sqlite.sql to create the database and load it with data. But i get:
C:\quickstart> php scripts\load.mysql.php --withdata
AN ERROR HAS OCCURED:
SQLSTATE[42000] [1049] Unknown database 'c:\quickstart\data\db\guestbook-dev.db'
My application\configs\application.ini looks like:
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
resources.view[] =
resources.db.adapter = "PDO_MYSQL"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.host = "localhost"
resources.db.params.dbname = "C:\quickstart\data\db\guestbook-dev.db"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
再看一下快速启动,您使用了错误的适配器
APPLICATION_PATH 在 /public 目录的 index.php 文件中设置
编辑:
正如您所指出的,您正在使用 MySQL,那么适配器是正确的,并且数据库名称错误。
查看您使用的数据库名称并更改配置。它当前正在您的文件系统中而不是 MySQL 数据库中查找数据库。
Have another look at the quick start, you're using the wrong adapter
APPLICATION_PATH is set in the index.php file in the /public directory
Edit :
As you've pointed out that you're using MySQL then the adapter is correct and the dbname is wrong.
Have a look what the database you are using is called and change config. It's currently looking for a database in your file system not in your MySQL database.