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

CentOS 7 MySQL 8 Can't get past create database #56

Closed v1cdang closed 4 years ago

v1cdang commented 4 years ago

I have a newly installed mysql database server on CentOS 7, when I try running opensips-cli and then "database create" It creates the database, then shows

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

my opensips-cli.cfg looks like this

[default] log_level: WARNING prompt_name: opensips-cli prompt_intro: Welcome to OpenSIPS Command Line Interface! prompt_emptyline_repeat_cmd: False history_file: ~/.opensips-cli.history history_file_size: 1000 output_type: pretty-print communication_type: fifo fifo_file: /tmp/opensips_fifo database_modules: ALL [mysql] database_admin_url: mysql://root@127.0.0.1:3306/opensips

liviuchircu commented 4 years ago

If you set the database_admin_url under the [mysql] CLI instance, did you connect with opensips-cli -i mysql? If not, I suggest you just put it simply under [default]. Maybe the docs are confusing -- let me see :)

v1cdang commented 4 years ago

@liviuchircu

I just tried that and it just creates the database opensips. It still doesn't create the tables

liviuchircu commented 4 years ago

Try to do database drop then database create. It should create the opensips database, with ALL modules (tables) ;)

v1cdang commented 4 years ago

No still getting this

(opensips-cli): database create Password for admin MySQL user (root): WARNING: database 'opensips' already exists! (opensips-cli): database drop Password for admin MySQL user (root): Do you really want to drop the 'opensips' database [y/n] (default: 'n'): y (opensips-cli): database create Password for admin MySQL user (root): ERROR: failed to connect to DB as opensips, please provide or fix the 'database_admin_url'

v1cdang commented 4 years ago

Is there a way I can just manually add tables in the database?

liviuchircu commented 4 years ago

Did you change anything in your opensips-cli.cfg in the meantime?

What opensips-cli version are you running? Is it latest? There has been a similar report a few days ago.

Is there a way I can just manually add tables in the database?

The DB schema files are located under /usr/share/opensips/mysql/....