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

Cannot find SQL scripts to execute #46

Closed zhongdongy closed 4 years ago

zhongdongy commented 4 years ago

Hi, thanks for your great work! I've noticed in my instance (Debian 9) with MySql, I am unable to create database properly. Here is my configuration file content:

database_name=opensips
database_url=mysql://root:xxx@localhost
template_url=mysql://root:xxx@localhost
database_modules=acc auth_db avpops clusterer drouting group load_balancer

I always run into this prompt during opensips-cli -x database create:

Please provide the path to the OpenSIPS DB scripts:

Currently, I think it might because the program was trying to find the SQL scripts to execute. But I found them nowhere.

liviuchircu commented 4 years ago

hey @zhongdongy ! Those scripts come with the opensips package, and opensips-cli should auto-detect their presence and not ask that question on a normal run. Do you actually need to install the database from a system that does not run opensips at all? If yes, we may need to do a few changes in there...

zhongdongy commented 4 years ago

Thank you for your information. I've installed opensips via apt already before compiling opensips-cli from source code. But just now I searched my VPS, there no such scripts under opensips directories. So I guess there might be something wrong with the auto detection mechanism in my case. And I think for now, I will try use scripts from opensips repository first.

hey @zhongdongy ! Those scripts come with the opensips package, and opensips-cli should auto-detect their presence and not ask that question on a normal run. Do you actually need to install the database from a system that does not run opensips at all? If yes, we may need to do a few changes in there...

liviuchircu commented 4 years ago

Sorry, @zhongdongy, my bad! It seems that the MySQL scripts are installed by the opensips-mysql-module package. Similarly, opensips-postgres-module if you run PostgreSQL, etc.

In your case, you should find them under /usr/share/opensips/mysql, and they should be auto-detected once the package is there :)

zhongdongy commented 4 years ago

Great! Thank you very much @liviuchircu ! Maybe we can add these instructions to the documents. 😄