您的位置:首页 > 数据库 > SQL

OpenSIPS启动时报ERROR:db_mysql:db_mysql_connect: driver error(1045)的解决方法

2014-06-13 21:17 2021 查看
启动OpenSIPS时,报下列错误

[root@OpenSIPS ~]# opensipsctl start

INFO: Starting OpenSIPS :

ERROR: PID file /var/run/opensips.pid does not exist -- OpenSIPS start failed

 查看日志文件

[root@OpenSIPS ~]# tail /var/log/messages

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:db_mysql:db_mysql_connect: driver error(1045): Access denied for user
'opensips'@'localhost' (using password: YES)

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:core:db_do_init: could not add connection to the pool

Jun  4 13:34:36 OpenSI
a3de
PS /sbin/opensips[53232]: ERROR:acc:acc_db_init: unable to connect to the database

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:acc:mod_init: failed...did you load a database module?

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:core:init_mod: failed to initialize module acc

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: ERROR:core:main: error while initializing modules

Jun  4 13:34:36 OpenSIPS /sbin/opensips[53232]: INFO:core:cleanup: cleanup

Jun  4 13:34:36 OpenSIPS opensips: INFO:core:daemonize: pre-daemon process exiting with -1

解决方法:

mysql> grant all privileges on opensips.* to opensips@localhost identified by 'opensipsrw';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

重新启动OpenSIPS

[root@OpenSIPS ~]# opensipsctl start

INFO: Starting OpenSIPS :

INFO: started (pid: 53374)

问题解决!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  opensips
相关文章推荐