PHP database connection pool SQL relay installation using

Source: Internet
Author: User
Tags ibm db2 php database
From: http://blog.csdn.net/21aspnet/article/details/50774684


SQL Relay According to its official website Http://sqlrelay.sourceforge.net/index.html said is: A powerful database connection management solution.

Translate to Chinese This means that SQL relay is an open source database pool connection Proxy server.

There are many databases supported by SQL relay:

SQL Relay supports Oracle, MySQL, PostgreSQL, Sap/sybase, IBM DB2, Informix, Firebird and SQLite databases Direct Ly, using the native Client API ' s for those databases.
Support was provided for Microsoft SQL Server via the freetds API.

The supported APIs are also very rich

Guides:c++, C, C #, Perl, PHP, Python, Ruby, Java, TCL, Erlang, node. js
References:c++, C, C #, Perl, PHP, Python, Ruby, Java, TCL, node. js,

I tell how to use the connection pool in the LINUX+PHP+FREEDTS environment, in fact Php->sql relay->freedts-> database such architecture.

The following says the installation uses

1. Install Rudiments First

Recommended to install the new version, the old version may be error needs to be resolved.

# wget Http://sourceforge.net/projects/rudiments/files/rudiments/0.28.2/rudiments-0.28.2.tar.gz/download
# tar Xvzf rudiments-0.54.tar.gz
# CD rudiments-0.54
#./configure--prefix=/usr/local/rudiments
# Make && make install

2. Re-install Sqlrelay

# wget Https://sourceforge.net/projects/sqlrelay/files/sqlrelay/0.64/sqlrelay-0.64.tar.gz/download
# tar Vxzf sqlrelay-0.64.tar.gz
# CD sqlrelay-0.64
#./configure--prefix=/usr/local/sqlrelay--with-rudiments-prefix=/usr/local/rudiments--with-freetds-prefix=/usr /local/freetds--with-php-prefix=/usr/local/php


# Make && make install

3. Modify the PHP configuration file

# Vim/usr/local/php/lib/php.ini
Increase extension

Extension = "sql_relay.so"
Note: You need to confirm phpinfo

4. Modify the Freedts configuration

Installation reference for Freedts this article: http://blog.csdn.net/unix21/article/details/47449901

Modify the FreeTDS configuration file freetds.conf
# vim/usr/local/freetds/etc/freetds.conf

Add the following content

[msdetest]host = 192.168.1.1port =1433tds Version = 7.0client charset = UTF-8
Otherwise it will be garbled in Chinese, need the corresponding encoding type GB2312 and so on.

5. Modify the SQL Relay configuration file

# cd/usr/local/sqlrelay/etc/
# CP Sqlrelay.conf.example sqlrelay.conf
# Vim Sqlrelay.conf

The entire configuration is very well understood

 
  
 
  
  
   
   
    
    
     
   
    
   
    
    
     
   
    
  
   
 
  

6. Start SQL Replay

# Export path= $PATH:/usr/local/sqlrelay/bin
Start:

# Sqlr-start-id MSDE

is a successful startup if the configuration error prompts the database to not connect.

SQL Tools

# Sqlrsh-id MSDE


7.php Using connection pooling

 
  \ n ";} Sqlrcur_free ($cur); Sqlrcon_free ($con);? >

Front page fetching data from connection pool

PHP function API for SQL Relay

Http://sqlrelay.sourceforge.net/sqlrelay/programming/php.html

Reference: http://www.cnblogs.com/zhangjun516/archive/2013/03/12/2955162.html

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.