尝试将 ejabberd 与 MySQL 数据库连接时报告错误。这可能与数据库名称有关。尝试连接另一个不带“-”字符的数据库后,ejabberd 服务器使用 MySQL 数据库成功启动。在 ejabberd.cfg 文件中,我取消注释了以下行以使用 MySQL 数据库,并进行了其他更改
{odbc_server, {mysql, "localhost", "ejaaberddb-dev", "admin", "password"}}.
错误如下:
@ejabberd_odbc:log:574 p1_mysql_conn: Failed changing to database "ejaaberddb-dev" : "#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-dev' at line 1"
您能否建议我如何从 ejabberd 连接到上述数据库?
最佳答案
在数据库名称周围添加“`”字符后解决了问题。
{odbc_server, {mysql, "localhost", "`ejaaberddb-dev`", "admin", "password"}}.
关于mysql - ejabberd MySQL连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24758392/