在 Linux 上使用 MySQL 的 Mobilink

Posted

技术标签:

【中文标题】在 Linux 上使用 MySQL 的 Mobilink【英文标题】:Mobilink with MySQL on Linux 【发布时间】:2012-03-27 23:50:58 【问题描述】:

我正在尝试将 MobiLink 配置为使用本地主机上的 mysql 数据库。

我正在使用: - mysql-connector-odbc-5.1.10 - SQL Anywhere 12.0.1 开发者版

我正在关注本教程 http://www.sybase.com/detail?id=1056497,但在 Linux Mint 11 x64 上工作。

我已经安装了 Mobilink,为我的 MySQL 数据库配置了 ODBC 连接器,现在我尝试使用以下命令启动 MobiLink 同步服务器:

/bin64s/mlsrv12 -v+ -o mlsrv.out -zs ml_mysql -c "DSN=sa11_ML-connector;uid=root;pwd=my_pass" -dl -zu+ -x tcpipport=2639

我收到此错误:

(...)
I. 2012-03-28 01:25:50. <Main> Timeout for inactive database connections: 60 minutes
I. 2012-03-28 01:25:50. <Main> Maximum delay between retries after deadlock: 30 seconds
I. 2012-03-28 01:25:50. <Main> Rowset size: 10
I. 2012-03-28 01:25:50. <Main> Number of database worker threads: 5
W. 2012-03-28 01:25:50. <Main> [10064] Unknown users will be added automatically (when there is no authenticate_user script)
Unable to load 'MySQL ODBC 5.1 Driver' errno=2
I. 2012-03-28 01:25:50. <Main> Shared administrative connection connected
I. 2012-03-28 01:25:50. <Main> System event on shared administrative connection:
                    SELECT count(*) FROM ml_scripts_modified
I. 2012-03-28 01:25:50. <Main> Translated SQL:
                    SELECT count(*) FROM ml_scripts_modified
E. 2012-03-28 01:25:50. <Main> [-10379] The ODBC connection string specifies a driver that is not compatible with 64-bit MobiLink
I. 2012-03-28 01:25:50. <Main> Shared administrative connection disconnected
E. 2012-03-28 01:25:50. <Main> [-10382] The MobiLink Server has failed to start

我从这里下载了最新的 ODBC 连接器:http://dev.mysql.com/downloads/connector/odbc/5.1.html,并尝试了 - 通用 Linux(x86,32 位),RPM 包 - Linux版本。 .3.glibc2(x86,64 位),压缩 TAR 存档

它们都返回该错误,并且应该与 MobiLink x64 完全兼容(我认为是这样......)。

有什么想法吗?

干杯。


我已将 odbc 配置文件复制到另一个位置(在 strace 中找到,MobiLink 扫描 ~/.ODBC.ini 以获取配置文件)但现在我遇到另一个错误...

I. 2012-03-28 15:45:21. SQL Anywhere MobiLink Server Version 12.0.1.3457
I. 2012-03-28 15:45:21. 
I. 2012-03-28 15:45:21. Copyright (c) 2001-2011, iAnywhere Solutions, Inc.
I. 2012-03-28 15:45:21. Portions copyright (c) 1988-2011, Sybase, Inc. All rights reserved.
I. 2012-03-28 15:45:21. Use of this software is governed by the Sybase License Agreement.
I. 2012-03-28 15:45:21. Refer to http://www.sybase.com/softwarelicenses.
I. 2012-03-28 15:45:21. 
I. 2012-03-28 15:45:21. This server is licensed to:
I. 2012-03-28 15:45:21.     Developer Edition
I. 2012-03-28 15:45:21.     Restricted Use
I. 2012-03-28 15:45:21. Running Linux 2.6.38-13-generic #57-Ubuntu SMP Mon Mar 5 18:29:54 UTC 2012 on X86_64
I. 2012-03-28 15:45:21. Server built for X86_64 processor architecture
I. 2012-03-28 15:45:21. <Main> Option 1: -v+
I. 2012-03-28 15:45:21. <Main> Option 2: -o
I. 2012-03-28 15:45:21. <Main> Option 3: mlsrv.out
I. 2012-03-28 15:45:21. <Main> Option 4: -zs
I. 2012-03-28 15:45:21. <Main> Option 5: ml_mysql
I. 2012-03-28 15:45:21. <Main> Option 6: -c
I. 2012-03-28 15:45:21. <Main> Option 7: DSN=sa11_ML-connector;uid=root;pwd=********
I. 2012-03-28 15:45:21. <Main> Option 8: -dl
I. 2012-03-28 15:45:21. <Main> Option 9: -zu+
I. 2012-03-28 15:45:21. <Main> Option 10: -x
I. 2012-03-28 15:45:21. <Main> Option 11: tcpipport=2639
I. 2012-03-28 15:45:21. <Main> Verbose logging: show upload row values
I. 2012-03-28 15:45:21. <Main> Verbose logging: show download row values
I. 2012-03-28 15:45:21. <Main> Verbose logging: show script names when invoked
I. 2012-03-28 15:45:21. <Main> Verbose logging: show script contents when invoked
I. 2012-03-28 15:45:21. <Main> Verbose logging: show schema for each table
I. 2012-03-28 15:45:21. <Main> Verbose logging: show an error when the first read of a synchronization fails
I. 2012-03-28 15:45:21. <Main> Verbose logging: show translated SQL for prepared statements
I. 2012-03-28 15:45:21. <Main> Verbose logging: show rowcount values
I. 2012-03-28 15:45:21. <Main> Cache size: 52428800 bytes
I. 2012-03-28 15:45:21. <Main> Download cache directory size: 10485760 bytes
I. 2012-03-28 15:45:21. <Main> Local file for remote synchronization logs: 'mlsrv.mle'
I. 2012-03-28 15:45:21. <Main> Starting cache sizes: min of 52428800 bytes; max of 2906351616 bytes; initial size of 52064256 bytes
I. 2012-03-28 15:45:21. <Main> Individual database connections will be closed after synchronization errors
I. 2012-03-28 15:45:21. <Main> Maximum number of BLOB bytes to compare: 4294967295
I. 2012-03-28 15:45:21. <Main> Maximum number of database connections: 5
I. 2012-03-28 15:45:21. <Main> Maximum number of deadlock retries: 10
I. 2012-03-28 15:45:21. <Main> Timeout for inactive database connections: 60 minutes
I. 2012-03-28 15:45:21. <Main> Maximum delay between retries after deadlock: 30 seconds
I. 2012-03-28 15:45:21. <Main> Rowset size: 10
I. 2012-03-28 15:45:21. <Main> Number of database worker threads: 5
W. 2012-03-28 15:45:21. <Main> [10064] Unknown users will be added automatically (when there is no authenticate_user script)
Unable to load '/usr/lib64/libmyodbc5.so' errno=0
I. 2012-03-28 15:45:21. <Main> Shared administrative connection connected
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT count(*) FROM ml_scripts_modified
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT count(*) FROM ml_scripts_modified
I. 2012-03-28 15:45:21. <Main> ODBC DBMS Name: MySQL
I. 2012-03-28 15:45:21. <Main> ODBC DBMS Version: 5.1.61-0ubuntu0.11.04.1
I. 2012-03-28 15:45:21. <Main> ODBC DBMS Driver Version: 05.01.0010
I. 2012-03-28 15:45:21. <Main> ODBC Version supported by the driver: 3.51
I. 2012-03-28 15:45:21. <Main> Collation sequence of the consolidated database is 'utf8_general_ci'
I. 2012-03-28 15:45:21. <Main> ODBC DBMS Type: MySQL
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        set innodb_table_locks = 0
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        set innodb_table_locks = 0
I. 2012-03-28 15:45:21. <Main> ODBC isolation set to: Read Committed
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT user_id, name, hashed_password FROM ml_user WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT user_id, name, hashed_password FROM ml_user WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT rid, remote_id, script_ldt, description FROM ml_database WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT rid, remote_id, script_ldt, description FROM ml_database WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT rid, subscription_id, user_id, progress, publication_name, last_upload_time, last_download_time FROM ml_subscription WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT rid, subscription_id, user_id, progress, publication_name, last_upload_time, last_download_time FROM ml_subscription WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT table_id, name FROM ml_table WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT table_id, name FROM ml_table WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT component_name, property_set_name, property_name, property_value FROM ml_property WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT component_name, property_set_name, property_name, property_value FROM ml_property WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT script_id, script, script_language FROM ml_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT script_id, script, script_language FROM ml_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT version_id, name, description FROM ml_script_version WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT version_id, name, description FROM ml_script_version WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT version_id, event, script_id FROM ml_connection_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT version_id, event, script_id FROM ml_connection_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT version_id, table_id, event, script_id FROM ml_table_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT version_id, table_id, event, script_id FROM ml_table_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT last_modified FROM ml_scripts_modified WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT last_modified FROM ml_scripts_modified WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT version_id, table_id, idx, name, type FROM ml_column WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT version_id, table_id, idx, name, type FROM ml_column WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT server_id, name, connection_info, instance_key, start_time FROM ml_primary_server WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT server_id, name, connection_info, instance_key, start_time FROM ml_primary_server WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT script_id, script_name, flags, affected_pubs, script, description FROM ml_passthrough_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT script_id, script_name, flags, affected_pubs, script, description FROM ml_passthrough_script WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT remote_id, run_order, script_id, last_modified FROM ml_passthrough WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT remote_id, run_order, script_id, last_modified FROM ml_passthrough WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT status_id, remote_id, run_order, script_id, script_status, error_code, error_text, remote_run_time FROM ml_passthrough_status WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT status_id, remote_id, run_order, script_id, script_status, error_code, error_text, remote_run_time FROM ml_passthrough_status WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT failed_script_id, error_code, new_script_id, action FROM ml_passthrough_repair WHERE 1=2
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT failed_script_id, error_code, new_script_id, action FROM ml_passthrough_repair WHERE 1=2
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT count(*) FROM ml_scripts_modified
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT count(*) FROM ml_scripts_modified
I. 2012-03-28 15:45:21. <Main> This software is using security technology from Certicom Corp.
I. 2012-03-28 15:45:21. <Main> System event on shared administrative connection:
                        SELECT property_set_name, property_name, property_value FROM ml_property WHERE component_name = ? ORDER BY property_set_name 
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        SELECT property_set_name, property_name, property_value FROM ml_property WHERE component_name = ? ORDER BY property_set_name 
I. 2012-03-28 15:45:21. <Main> Notifier stage connection connected
I. 2012-03-28 15:45:21. <Main> System event on the notifier stage connection:
                        set innodb_table_locks = 0
I. 2012-03-28 15:45:21. <Main> Translated SQL:
                        set innodb_table_locks = 0
I. 2012-03-28 15:45:21. <Main> MobiLink server started
Press 'q' to quit MobiLink server
Interrupted

似乎它现在正在使用我的数据库,但仍然存在:

W. 2012-03-28 15:45:21. <Main> [10064] Unknown users will be added automatically (when there is no authenticate_user script)
    Unable to load '/usr/lib64/libmyodbc5.so' errno=0

/usr/lib64/libmyodbc5.so 下是我的 ODBC 驱动程序。

【问题讨论】:

errno=2 转换为 No such file or directory。如果您 strace(1) 您的程序,您可能能够判断它正在尝试访问哪个特定文件,并进行符号链接或以其他方式解决问题。 哎呀,对不起,我不是故意要发布整件事的; strace(1) 仅获取 部分 系统调用数据,但它可能已获取部分密码或密钥。请验证输出以确保它不包含私人数据或在必要时更改密码和凭据。 (我只是希望你能在某处发现丢失的 ODBC 驱动程序......) 很遗憾现在我在其中找不到任何有趣的东西(即使它在那里),我稍后会分析它。 (而且我之前尝试过扫描它以获取密码。) 【参考方案1】:

确保您使用的是recommended MySQL ODBC driver,并按照说明将该驱动程序与 MobiLink 一起使用。

Other ways to get help with SQL Anywhere and MobiLink.

【讨论】:

以上是关于在 Linux 上使用 MySQL 的 Mobilink的主要内容,如果未能解决你的问题,请参考以下文章

css 反向柱påmobil

在 Linux 上使用 MySQL 的 Mobilink

linux 上 mysql 的使用

在Linux上安装MySql

怎样在 Ubuntu Linux 上安装 MySQL

如何在 Linux 上使用 Qt5 访问远程 MySQL 服务器?