OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
85 stars 48 forks source link

ERROR: failed to connect to DB as root, please provide or fix the 'database_admin_url' #52

Closed lesvere closed 4 years ago

lesvere commented 4 years ago

pyhton3.4 install cli tools.

  1. run opensips-cli -f /usr/local/etc/opensips/opensips-cli.cfg
  2. database create then input my root password: root. It always return:

ERROR:`` failed to connect to DB as root, please provide or fix the 'database_admin_url'

This my fully opensips-cli.cfg content:

[default] database_modules: dialog usrloc [mysql] database_admin_url: mysql://root@192.168.7.242:3306/opensips

liviuchircu commented 4 years ago

Thank you for the report, @lesvere! First, please make sure access works using the console:

mysql -uroot -p<password> -h192.168.7.242

I suspect you have only granted access for -hlocalhost or -h127.0.0.1, hence why login to the NIC IP address isn't working.

Once you are 100% sure you have the right credentials, you may even include the password into the opensips-cli.cfg file, for quick access, as follows:

database_admin_url: mysql://root:password@192.168.7.242:3306/opensips
lesvere commented 4 years ago

Thans for your reply.

Before I had depoly opensips on base system, and depoly oensips-cp on docker.

Now, I had resolved that problem!

But i have other problem, this is link: https://github.com/OpenSIPS/opensips-cli/issues/54