Home Database Mysql Tutorial SQL Relay开源的数据库池连接代理服务器

SQL Relay开源的数据库池连接代理服务器

Jun 07, 2016 pm 03:15 PM
relay sql acting Open source database server connect

一、SQL Relay是什么? SQL Relay是一个开源的数据库池连接代理服务器 二、SQL Relay支持哪些数据库? * Oracle * MySQL * mSQL * PostgreSQL * Sybase * MS SQL Server * IBM DB2 * Interbase * Sybase * SQLite * Lago * ODBC * MS Access 三、安装和配置

一、SQL Relay是什么?

SQL Relay是一个开源的数据库池连接代理服务器


二、SQL Relay支持哪些数据库?

<span> * Oracle<br>* MySQL<br>* mSQL<br>* PostgreSQL<br>* Sybase<br>* MS SQL Server<br>* IBM DB2<br>* Interbase<br>* Sybase<br>* SQLite<br>* Lago<br>* ODBC<br>* MS Access</span>


三、安装和配置;

不说废话了,开始安装SQL Relay,到 http://sqlrelay.sourceforge.net/ 去下载相应的软件
安装SQL Relay需要先安装Rudiments, 在 http://sqlrelay.sourceforge.net/download.html 可以找到


1、安装Rudiments:

<span># tar vxzf rudiments-0.28.2.tar.gz<br># cd rudiments-0.28.2<br># ./configure --prefix=/usr/local/rudiments<br># make<br># make install</span>

至此,rudiments安装结束


2、安装SQL Relay:

<span># tar vxzf sqlrelay-0.36.4.tar.gz<br># cd sqlrelay-0.36.4<br># ./configure --prefix=/usr/local/sqlrelay --with-rudiments-prefix=/usr/local/rudiments --with-mysql-prefix=MySQL安装路径 --with-freetds-prefix=FreeTDS安装路径 --with-oracle-home=Oracle安装路径 --with-php-prefix=PHP安装路径<br># make<br># make install</span>

安装结束,以上编译参数根据个人需要来设定,因为我同时需要Oracle SQLserver MySQL,所以才加了这么多参数的

3、设置PHP:

修改php.ini

<span>extension_dir = "./"</span>

把以上内容修改为:

<span>extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20050922"</span>

根据PHP安装的路径来修改,并不是每个版本的PHP都是这个路径
在php.ini中添加如下内容

<span>extension=sql_relay.so</span>

接下来,介绍SQL Relay如何连接SQL Server
修改FreeTDS的配置文件freetds.conf
加入如下内容:

<span>[msde]<br>host = 172.16.20.203<br>port =1433<br>tds version = 8.0<br>client charset = GB2312</span>

请根据个人需求来修改


4、修改SQL Relay的配置文件

<span># cd /usr/local/sqlrelay/etc<br># cp sqlrelay.conf.example sqlrelay.conf</span>

把sqlrelay.conf的内容改为:

<span><?xml version="1.0"?><br><br><br><br><br><br><br><br><br><br><br></span>


四、启动SQL Relay,并测试;


1、启动 SQL Relay

<span># export PATH=$PATH:/usr/local/sqlrelay/bin<br># sqlr-start -id msdetest</span>


2、使用SQL工具:

<span># sqlrsh -id msdetest</span>

可以直接输入SQL语句

停止SQL Relay:

<span># sqlr-stop msdetest</span>


3、测试PHP:

写一个PHP文件,内容如下:

<span><br>$con=sqlrcon_alloc("msdetest",9000,"/tmp/msdetest.socket","sa","sa",0,1);<br>$cur=sqlrcur_alloc($con);<br>sqlrcur_sendQuery($cur,"select * from t_gifts");<br>for ($row=0; $row<sqlrcur_rowcount></sqlrcur_rowcount>for ($col=0; $col<sqlrcur_colcount></sqlrcur_colcount>echo sqlrcur_getField($cur,$row,$col);<br>echo ",";<br>}<br>echo "<br>\n";<br>}<br>sqlrcur_free($cur);<br>sqlrcon_free($con);<br>?></span>

执行这个PHP文件,看看能不能出现数据
全文结束~~

 

参考:http://hi.baidu.com/mrvsumbeujeinxe/item/8ba0c60888cf47c490571896

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Apr 29, 2024 pm 04:55 PM

FP8 and lower floating point quantification precision are no longer the "patent" of H100! Lao Huang wanted everyone to use INT8/INT4, and the Microsoft DeepSpeed ​​team started running FP6 on A100 without official support from NVIDIA. Test results show that the new method TC-FPx's FP6 quantization on A100 is close to or occasionally faster than INT4, and has higher accuracy than the latter. On top of this, there is also end-to-end large model support, which has been open sourced and integrated into deep learning inference frameworks such as DeepSpeed. This result also has an immediate effect on accelerating large models - under this framework, using a single card to run Llama, the throughput is 2.65 times higher than that of dual cards. one

Domestic open source MoE indicators explode: GPT-4 level capabilities, API price is only one percent Domestic open source MoE indicators explode: GPT-4 level capabilities, API price is only one percent May 07, 2024 pm 05:34 PM

The latest large-scale domestic open source MoE model has become popular just after its debut. The performance of DeepSeek-V2 reaches GPT-4 level, but it is open source, free for commercial use, and the API price is only one percent of GPT-4-Turbo. Therefore, as soon as it was released, it immediately triggered a lot of discussion. Judging from the published performance indicators, DeepSeekV2's comprehensive Chinese capabilities surpass those of many open source models. At the same time, closed source models such as GPT-4Turbo and Wenkuai 4.0 are also in the first echelon. The comprehensive English ability is also in the same first echelon as LLaMA3-70B, and surpasses Mixtral8x22B, which is also a MoE. It also shows good performance in knowledge, mathematics, reasoning, programming, etc. And supports 128K context. Picture this

Share several .NET open source AI and LLM related project frameworks Share several .NET open source AI and LLM related project frameworks May 06, 2024 pm 04:43 PM

The development of artificial intelligence (AI) technologies is in full swing today, and they have shown great potential and influence in various fields. Today Dayao will share with you 4 .NET open source AI model LLM related project frameworks, hoping to provide you with some reference. https://github.com/YSGStudyHards/DotNetGuide/blob/main/docs/DotNet/DotNetProjectPicks.mdSemanticKernelSemanticKernel is an open source software development kit (SDK) designed to integrate large language models (LLM) such as OpenAI, Azure

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Equipped with AMD EPYC 4004 series processors, ASUS launches a variety of server and workstation products Jul 23, 2024 pm 09:34 PM

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

See all articles