phpBB和mySQL“;无法连接到数据库…”;

phpBB和mySQL“;无法连接到数据库…”;,php,mysql,phpbb,Php,Mysql,Phpbb,我正试图在本地托管的网页上建立一个phpBB论坛。它是在openSUSE Linux操作系统中完成的 我已经安装了MariaDB(MySQL),并使用命令createdatabasenew\u database创建了一个名为new\u database的新数据库,以及名为user的用户,使用命令CREATE user'new_user'@'localhost'由“password”标识。我还将root密码更改为password,仅用于测试目的 当我在phpBB安装数据库设置屏幕中输入此信息时,我

我正试图在本地托管的网页上建立一个phpBB论坛。它是在openSUSE Linux操作系统中完成的

我已经安装了MariaDB(MySQL),并使用命令
createdatabasenew\u database
创建了一个名为
new\u database的新数据库
,以及名为
user
的用户,使用命令
CREATE user'new_user'@'localhost'由“password”标识。我还将root密码更改为
password
,仅用于测试目的

当我在phpBB安装数据库设置屏幕中输入此信息时,我得到了错误信息

无法连接到数据库,请参阅下面的错误消息

拒绝用户'new_user'@'localhost'访问数据库'new_database'


我正在为DSN使用
localhost
。有什么想法吗?从我在网上找到的所有信息来看,它应该是有效的…

在创建用户后,您必须授予特权,您就是这样做的

GRANT ALL PRIVILEGES ON new_database.* TO 'newuser'@'localhost';
别忘了冲洗

FLUSH PRIVILEGES
共同特权

ALL PRIVILEGES- all access
CREATE- allows them to create new tables or databases
DROP- allows them to them to delete tables or databases
DELETE- allows them to delete rows from tables
INSERT- allows them to insert rows into tables
SELECT- allows them to use the Select command to read through databases
UPDATE- allow them to update table rows
GRANT OPTION- allows them to grant or remove other users' privileges
您可以指定数据库和表

new_database.* (Specific Database, all tables)
new_database.table (Specific Database, specific table)
*.* (all databases, al tables)

我在安装phpBB时遇到了同样的问题,通过phpMyAdmin访问数据库并注意到启动页面上写着“用户:pits@localhost“,这与我创建并连接到数据库并试图连接的用户(pits_bull)不同

我只是用“坑”试了一下,效果不错。虽然不确定是否存在安全问题,或者它为什么工作,但它正在工作