如何使用MySQL设置bolt CMS?

时间:2016-09-14 07:32:18

标签: mysql bolt-cms

我正在使用Bolt CMS,基本上数据库配置文件是一个YML文件,如下所示:

# 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与Bolt合作吗?

1 个答案:

答案 0 :(得分:1)

因为您的驱动程序名称不正确。

使用driver: mysql