mysql client build

来源:互联网 发布:家具图纸设计软件 编辑:程序博客网 时间:2024/06/11 14:55

mysql linux c connection pool

http://www.tildeslash.com/libzdb/

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


http://www.techsww.com/tutorials/database_management_systems/mysql/installation/how_to_install_mysql_client_ubuntu_linux.php

NOTE: I am not going to explain how to install MySQL Database Server (DBMS System) in this tutorial. This tutorial only explains how to install theclient libraries, so that other software (e.g. PHP) can use the libraries to access MySQL Server installed on some other computer. Also,note that I am going to compile and install the client, so please do not message me and tell me that this can be done using Ubuntu package manager. I already know that and also know the commands but I am only showing another method for installation to people like me who want to do everything themselves. This tutorial will also be of some benefit to people who like to try the latest releases.

Before starting, please check to see if there is a latest version available to download. Visit http://dev.mysql.com/downloads/mysql/5.0.html#source to find out about the latest available versions of MySQL version 5.IMPORTANT: See"Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install MySQL Client from source code.

Steps to download, compile, and install are as follows. Note: Replace 5.0.45 with your version number:
  • Before installing MySQL Client you have to install the development packages of libncurses and zlib, so let us do that by running the commands below.

    apt-get install libncurses5-devapt-get install zlib1g-dev
  • Downloading MySQL:

    Run the command below,
    wget \http://dev.mysql.com/get/Downloads/MySQL-5.0/\mysql-5.0.45.tar.gz/from/http://mysql.mirror.rafal.ca/

    I downloaded the source file from a Canadian mirror. Please visit http://dev.mysql.com/downloads/mysql/5.0.html#source to find a mirror near you.

    Also, download the MD5 hash to verify the integrity of the downloaded file.

    wget \http://dev.mysql.com/get/Downloads/MySQL-5.0/\mysql-5.0.45.tar.gz.md5/from/http://mysql.mirror.rafal.ca/

    Click here to find out how to check the integrity of downloaded files using MD5Sums. You can also get the MD5Sum signature (in red circle in the image below) from MySQL's website (recommended) on thedownloads page.

    MySQL Download Page

    Please note that if you are using MySQL client for a highly secure/critical setup (or for any other reason) then you should also check the PGP signatures (not covered in this tutorial for simplicity).

  • Extracting files from the downloaded package:

    tar -xvzf mysql-5.0.45.tar.gz

    Now, enter the directory where the package is extracted.

    cd mysql-5.0.45

  • Installing zlib:

    Click here to find out how to install zlib before configuring and installing MySQL client libraries and tools.

  • Configuring MySQL source code:

    ./configure --without-server --enable-thread-safe-client \  --with-client-ldflags=-all-static --prefix=/usr/local/mysql \   --with-machine-type=powerpc --with-zlib-dir=/usr/local/zlib \    --without-debug  --without-docs --with-big-tables 
    Replace "/usr/local/mysql" with the path where you want to install MySQL libraries and also replace "/usr/local/zlib" with your zlib directory. You also have to replace "powerpc" with your architecture type. Note: check for any error message.
  • Compiling MySQL source code:

    make

    Note: check for any error message.

  • Installing MySQL source code:

    As root (for privileges on destination directory), run the following.

    With sudo,

    sudo make install

    Without sudo,

    make install

    Note: check for any error messages.

  • More Configuration (setting PATH variable and library path):

    sudo echo '/usr/local/mysql/lib/' >> /etc/ld.so.confsudo ldconfig

    Also, run the following.

    PATH=$PATH:/usr/local/mysql/bin

    Replace "/usr/local/mysql" with your installation directory. If you are running the BASH shell then do the following to make changes to PATH variable permanent.

    echo "PATH=\$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
  • Testing the installation:

    Run the command below

    mysql -h192.168.5.15 -utest -p

    Replace "192.168.5.15" with your MySQL server host name and "test" with your user name (user name on MySQL database server). You'll be prompted for a password. Enter the password. If the password is entered correctly you should see MySQL client console (see the image below).

    MySQL command line console

That’s it. MySQL Client tools, binaries, and library have been successfully installed.



原创粉丝点击