无法使用 mysql 为 wordpress 创建数据库

can't create database with mysql for wordpress

我正在尝试使用以下命令创建用户。我收到以下错误。

CREATE DATABASE wp-test;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-isdi' at line 1.

我正在尝试安装 wordpress,但在完成所有步骤后,我遇到了以下错误。

This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

最好在数据库和 table 名称中使用下划线而不是连字符,因为在这种情况下连字符不是有效标识符,您需要在数据库名称周围使用反引号。

示例:

CREATE DATABASE `wp-test`;

试试这个 sql 命令来创建用户

CREATE USER 'suraj'@'localhost';GRANT USAGE ON *.* TO 'suraj'@'localhost' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

并赋予用户所有权限..