sqlbox寻找mysql而不是mssql [英] sqlbox looking for mysql instead of mssql

查看:95
本文介绍了sqlbox寻找mysql而不是mssql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图启动sqlbox,但是它慌了,我跑了:

I tried to start the sqlbox but it panicked, I ran:

sqlbox -v 0 /etc/kannel/sqlbox.conf

下面是日志:

2017-08-31 13:27:56 [18635] [0] INFO: Debug_lvl = 0, log_file = <none>, log_lvl = 0
2017-08-31 13:27:56 [18635] [0] DEBUG: Kannel sqlbox version `1.4.4'.
Build `Apr  5 2016 13:32:05', compiler `5.3.1 20160330'.
System Linux, release 4.4.0-93-generic, version #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017, machine x86_64.
Hostname smpp.bothsmsw.com, IP 127.0.0.1.
Libxml version 2.9.3.
Using OpenSSL 1.0.2g  1 Mar 2016.
Compiled with MySQL 5.7.11, using MySQL 5.7.19.
Compiled with PostgreSQL 9.5.2.
Using SQLite 3.11.0.
Using hiredis API 0.13.3
Using native malloc.

2017-08-31 13:27:56 [18635] [0] INFO: Starting to log to file /var/log/kannel/sqlbox.log level 0
2017-08-31 13:27:56 [18635] [0] INFO: Added logfile `/var/log/kannel/sqlbox.log' with level `0'.
2017-08-31 13:27:56 [18635] [0] PANIC: SQLBOX: MSSql: connection settings for id 'sqlbox-db' are not specified!
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(gw_backtrace+0xce) [0x42d07e]
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(gw_panic+0x16f) [0x42d1ff]
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(sqlbox_init_mssql+0x11e) [0x40dffe]
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(sqlbox_init_sql+0x9) [0x413239]
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(main+0x31d) [0x40c24d]
2017-08-31 13:27:56 [18635] [0] PANIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f3146101830]
2017-08-31 13:27:56 [18635] [0] PANIC: sqlbox(_start+0x29) [0x40c4d9]

我不为什么显示为PostgreSQL 9.5.2编译.我以前不使用它,如何只用mysql&重新编译.这是sqlbox的配置:

I don't why appearing as Compiled with PostgreSQL 9.5.2., I don't use it before, how I can recompile with mysql only & here is the sqlbox configuration:

#SQLBOX
group = sqlbox
id = sqlbox-db
smsbox-id = sqlbox
bearerbox-host = localhost
bearerbox-port = 18001
smsbox-port = 18005
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
log-level = 0
log-file = /var/log/kannel/sqlbox.log

# SQLBOX SETUP
group = mysql-connection
id = sqlbox-db
host = localhost
port = 3306
username = root
password = pass
database = kannel_db
max-connections = 25

有什么想法吗?

推荐答案

如本主题中所述

As replied in this topic Kannel Sqlbox not working (trying to connect to SQL Server instead of MySQL)? you can't use the apt-get packages as they are not built with the right parameters.

日志中描述的主要问题在那里:

The main problem as depicted in the log is there:

2017-08-31 13:27:56 [18635] [0] PANIC: SQLBOX: MSSql: connection settings for id 'sqlbox-db' are not specified!

实际上,您使用的版本存在问题( apt-get软件包是您无法在此处使用的旧版本),我在开始时遇到了相同的问题年.

In fact, there is a problem in the version that you are using (apt-get packages are old versions that you can't use there), I got the same problem at the beginning of the year.

这就是我的工作方式.

如果您已经使用apt-get软件包安装了Kannel,则必须先清洁计算机.

If you already installed Kannel with apt-get packages, you have to clean your machine first.

这里有一些线索可以找到您必须删除的项目. 我首先检查了发现狗窝"的每个地方:

Here are some clues to find the items that you have to remove. I first checked every place where "kannel" was found:

sudo find / -name "*kannel*"
sudo find / -name "*Kannel*"

然后我运行了以下命令(其中一些命令可能对您没有用,具体取决于您的设置等)

Then I ran the following commands (some of them may not be useful for you, depending on your settings, etc):

sudo apt-get autoremove --purge kannel
sudo rm -rf /etc/kannel/
sudo apt-get autoremove --purge kannel-sqlbox
sudo rm /var/cache/apt/archives/kannel-sqlbox_0.7.2-4build1_amd64.deb
sudo rm /var/cache/apt/archives/kannel-extras_1.4.4-2build1_amd64.deb
rm /home/nico/www-dev/kannelStore/kannel.store*
sudo rm -rf /usr/local/include/kannel
sudo rm -rf /usr/local/kannel
sudo rm -rf /usr/local/lib/kannel
rm /var/tmp/kannel.swp
sudo rm /usr/local/share/man/man8/kannel.8
sudo rm /usr/local/share/man/man8/run_kannel_box.8

还有sudo rm -rf /usr/local/sbin/(但要小心,具体取决于文件夹中已有的内容!)

And also sudo rm -rf /usr/local/sbin/ (but be careful here, depending on what you already have in the folder!)

注意:您将必须使用1.5.0版

Note: you will have to use version 1.5.0

首先添加将来的命令所需的所有软件包:

First add all the packages that you need for the future commands:

  • sudo apt-get install libxml2-dev(步骤./configure所需),否则您将获得配置:错误:必须安装libxml2(aka gnome-xml)库")

  • sudo apt-get install libxml2-dev (needed for step ./configure, or you will get "configure: error: You MUST have the libxml2 (aka gnome-xml) library installed")

sudo apt-get install libmysqlclient-dev(./configure --with-mysql所需)

sudo apt-get install bison(make所需)

sudo apt-get install libssh-dev libssl-dev(make所需,以避免发生此错误:"collect2:错误:ld返回1退出状态make:*** [test/test_http]错误1")

sudo apt-get install libssh-dev libssl-dev (needed for make to avoid getting this error: "collect2: error: ld returned 1 exit status make: *** [test/test_http] Error 1 ")

您将必须从svn存储库获取源.所以:

You will have to get the sources from a svn repository. So:

  • sudo apt install subversion如果您还没有Subversion(可以通过运行svn --version进行检查:如果没有答复,请使用命令)
  • sudo apt install subversion if you don't have subversion yet (you can check by running svn --version: if no reply, use the command)

然后:

  • 转到将在本地托管源的文件夹.例如在m端:cd ~/www-dev/nicopushkannel/Kannel/Kannel-Source

从存储库中获取Kannel源:svn co https://svn.kannel.org/gateway/trunk

Get Kannel sources from the repository: svn co https://svn.kannel.org/gateway/trunk

在上一步中,您应该位于Kannel源root foolder上. 如Kannel文档中所述,运行:

From the previous step you should be on Kannel sources root foolder. As described in Kannel documentation, run:

cd trunk
./bootstrap
./configure --with-mysql --with-mysql-dir=/var/lib/mysql
make

重要的是添加到./configure的参数:--with-mysql --with-mysql-dir=/var/lib/mysql

Here the important things are the parameters added to ./configure: --with-mysql --with-mysql-dir=/var/lib/mysql

然后安装:

sudo make bindir=/usr/local/kannel install

运行Kannel

完成此操作后,您可以尝试从命令行运行Kannel:

Run Kannel

Once this has been done, you can try to run Kannel from command line:

cd /usr/local/sbin
./bearerbox -v 0 /etc/kannel/kannel.conf


步骤3-从源代码安装最新的Kannel-sqlbox版本

注意:您需要安装Kannel(第2步)才能编译sqlbox.


Step 3 - Install latest Kannel-sqlbox version from the source

Note: You need to have Kannel installed (step 2) to compile sqlbox.

sqlbox包含在Kannel中继中:导航到文件夹:

sqlbox is included in Kannel trunk: navigate to the folder:

cd addons/sqlbox

修补程序引导文件

您可能需要修补引导文件以匹配您的autoconf版本(对我来说是1.15),因为代码不知道1.15大于1.11 ...

Patch bootstrap file

You may have to patch the bootstrap file to match your autoconf version (was 1.15 for me), as the code don't understand that 1.15 is > than 1.11...

更改以下值以匹配您的计算机版本的autoconf: 如果automake-1.11 --version>/dev/null 2>& 1;然后 amvers =-1.11"

Change the following value to match your machine version of autoconf: if automake-1.11 --version >/dev/null 2>&1; then amvers="-1.11"

对我来说,它变成了: 如果automake-1.15 --version>/dev/null 2>& 1;然后 amvers =-1.15"

So for me it became: if automake-1.15 --version >/dev/null 2>&1; then amvers="-1.15"

./bootstrap
./configure
make
sudo make install

我们完成了!

另一件事:如果要在Kannel启动时添加Sqlbox启动:

One more thing: if you want to add Sqlbox startup at Kannel startup:

sudo gedit /etc/default/kannel
Add "START_SQLBOX=1" line at the end

这篇关于sqlbox寻找mysql而不是mssql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆