stumped
stumped

Reputation: 1

Zend Framework tutorial - I keep getting sql error-Unknown database

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"

Upvotes: 0

Views: 1396

Answers (1)

piddl0r
piddl0r

Reputation: 2449

Have another look at the quick start, you're using the wrong adapter

resources.db.adapter = "PDO_SQLITE"
resources.db.params.dbname = APPLICATION_PATH."/../data/db/guestbook.db"

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.

Upvotes: 2

Related Questions