2016-09-14 213 views
0

嗨,我使用的螺栓CMS和basially數據庫配置文件是一個YML文件看起來像如下:如何設置螺栓CMS與MySQL?

# Database setup. The driver can be either 'sqlite', 'mysql' or 'postgres'. 
# 
# For SQLite, only the databasename is required. However, MySQL and PostgreSQL 
# also require 'username', 'password', and optionally 'host' (and 'port') if the database 
# server is not on the same host as the web server. 
# 
# If you're trying out Bolt, just keep it set to SQLite for now. 
database: 
    driver: mysqli 
    databasename: bolt 

如果我保留這些設置並導航到http://localhost:8080/bolt/public/

我可以看到登錄屏幕,但我想使用MySQL,所以我更改設置爲以下內容:

# Database setup. The driver can be either 'sqlite', 'mysql' or 'postgres'. 
# 
# For SQLite, only the databasename is required. However, MySQL and PostgreSQL 
# also require 'username', 'password', and optionally 'host' (and 'port') if the database 
# server is not on the same host as the web server. 
# 
# If you're trying out Bolt, just keep it set to SQLite for now. 
database: 
    driver: MySQL 
    databasename: bolt 
    host: localhost 
    username: root 
    password: 

現在我得到如下畫面:

http://imgur.com/E6GBkll

我會粘貼下面的錯誤太:

Fatal error: Uncaught exception 'Bolt\Exception\LowLevelDatabaseException' with message 'MySQL was selected as the database type, but it is not supported.' in C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Exception\LowLevelDatabaseException.php:41 Stack trace: #0 C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Configuration\LowlevelChecks.php(188): Bolt\Exception\LowLevelDatabaseException::unsupportedDriver('MySQL') #1 C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Configuration\ResourceManager.php(451): Bolt\Configuration\LowlevelChecks->doDatabaseCheck() #2 C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Configuration\ResourceManager.php(412): Bolt\Configuration\ResourceManager->verifyDb() #3 C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Configuration\ResourceManager.php(395): Bolt\Configuration\ResourceManager->postInitialize() #4 C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Application.php(59): Bolt\Configuration\ResourceManager->initialize() #5 C:\xampp\htdocs\bolt\vendor\bolt\bolt\app\bootstrap.php(123): Bolt\Application->__construct(Array) #6 in C:\xampp\htdocs\bolt\vendor\bolt\bolt\src\Exception\LowLevelDatabaseException.php on line 41 

任何想法如何,我可以讓MySQL與螺栓的工作?

謝謝。

回答

1

因爲您的驅動程序名稱不正確。使用driver: mysql