• Please post your message in it's related sections only. Accounts may be blocked or limited if you post in wrong category !

We are growing ! We are Looking for Forum Moderators for this site!

More than 3000 Registered Businesses | Top active VOIP forum | Interested ?..Click to Speak

Do you think this post is useful ?

  • Yes

  • No

  • SomeWhat


Results are only viewable after voting.
#1
Following is a guide on " How To install openSIPS 2.4 on Cent OS 8 " and "fixing opensipsdbctl CREATE USER failed for 'opensips'@'localhost' Error" .


The error may read like "You have an error in your SQL syntax; check the manual that corresponds to your My SQL server version for the right syntax to use near 'IDENTIFIED BY'........" when running opensipsdbctl command.

We will discuss how to fix this error along with the opensips installation on a Cent OS 8 system.

Please do not post any unrelated comments in this thread. If you require any help contact the admin or the author of this post.

--------------------------------------------------------------------------------------------


openSIPS 2.4 is the lowest version available which is stable . Sometimes you may want to install openSIPS 2.x on Newer Linux with Mysql 8.0 for some reasons.
You can install openSIPS with other RDBMS such as postgreSQL than MySQL . Though we believe that postgreSQL is faster than Mysql in terms of I/O operations and write operations, I prefer using mysql with openSIPS. With opensipsdbctl script openSIPS installs number of tables in database for storing user registration information ( registrar ), load balancer etc., roles .

First let us look into step by step openSIPS installation on CentOS 8.0. Installing openSIPS 2.4 on centOS 8 is a straight forward task .

Update centOS with the following command

yum update

Install epel-release repo and openSIPS repo

sudo yum install epel-release


We will install dependencies and also mysql server and mysql development libraries

yum install gcc gcc-c++ bison flex zlib-devel openssl-devel lynx subversion pcre-devel ncurses-devel python3 python3-pip python3-devel gcc mysql-devel python3-mysqlclient python3-sqlalchemy python3-pyOpenSSL mysql-devel mysql mysql-server mysql-libs

yum install https://yum.opensips.org/2.4/releases/el/8/x86_64/opensips-yum-releases-2.4-6.el8.noarch.rpm

If the link above is not working . You can clone git repo from here to compile and install from sources. Run below commands from source directory to compile and install opesips.
make prefix=/ all && make prefix=/ install









enable and start mysql

systemctl enable mysqld

systemctl start mysqld


Now fetch and install openSIPS package with below command

yum install opensips

enable and start opensips service

systemctl enable opensips


opensipsctl start



Now we will install database module libraries for opensips

yum install opensips-db_mysql opensips-db_postgresql opensips-db_sqlite opensips-db_berkeley


You may want to edit opensipsctlrc file to change database user name and password( recommended)

vi /etc/opensips/opensipsctlrc

uncomment or edit lines 'DBHOST=' , 'DBRWUSER= ' and 'DBRWPW='

Now you can create database tables with the comamnd opensipsdbctl create

If you encounter error like " You have an error in your SQL syntax; check the manual that corresponds to your My SQL server version for the right syntax to use near 'IDENTIFIED BY' " . This error occurs in mysql 8 because the user should exist prior to GRANT permission.

Now we need to edit the database script in this path. The schema import script on cent OS 8 64 bit is in this path /usr/lib64/opensips/opensipsctl/opensipsdbctl.mysql . The schema location might be different If you are installing openSIPS from sources.




CREATE USER '${DBRWUSER}'@'$DBHOST' IDENTIFIED BY '$DBRWPW';
#GRANT ALL PRIVILEGES ON $1.* TO '$DBRWUSER' IDENTIFIED BY '$DBRWPW';
GRANT ALL PRIVILEGES ON $1.* TO '${DBRWUSER}'@'$DBHOST' WITH GRANT OPTION;

Notice that second line has been commented . The above error occurs in mysql 8 , because the user entry should be created prior to GRANT permission .

Now opensipsdbctl create command should work and create the tables .
 

Contact us to advertise on this website!