<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        [原]Linux下基于源碼方式安裝MySQL5.6_MySQL

        來源:懂視網 責編:小采 時間:2020-11-09 19:18:52
        文檔

        [原]Linux下基于源碼方式安裝MySQL5.6_MySQL

        [原]Linux下基于源碼方式安裝MySQL5.6_MySQL:MySQL為開源數據庫,因此可以基于源碼實現安裝。基于源碼安裝有更多的靈活性。也就是說我們可以針對自己的硬件平臺選用合適的編譯器來優化編譯后的二進制代碼,根據不同的軟件平臺環境調整相關的編譯參數,選擇自身需要選擇不同的安裝組件,設定需要的字符集
        推薦度:
        導讀[原]Linux下基于源碼方式安裝MySQL5.6_MySQL:MySQL為開源數據庫,因此可以基于源碼實現安裝。基于源碼安裝有更多的靈活性。也就是說我們可以針對自己的硬件平臺選用合適的編譯器來優化編譯后的二進制代碼,根據不同的軟件平臺環境調整相關的編譯參數,選擇自身需要選擇不同的安裝組件,設定需要的字符集

        MySQL為開源數據庫,因此可以基于源碼實現安裝。基于源碼安裝有更多的靈活性。也就是說我們可以針對自己的硬件平臺選用合適的編譯器來優化編譯后的二進制代碼,根據不同的軟件平臺環境調整相關的編譯參數,選擇自身需要選擇不同的安裝組件,設定需要的字符集等等一些可以根據特定應用場景所作的各種調整。本文描述了如何在源碼方式下安裝MySQL。

        1、安裝環境及介質
        #安裝環境
        SZDB:~ #cat /etc/issue
        Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel /r (/l).
        SZDB:~ #uname -a
        Linux SZDB 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux

        #安裝介質,可以到以下網址下載安裝介質,注意下載時選擇source code,當前版本為5.6.17
        #根據你自身的環境下載相應的安裝介質,本文演示的安裝介質為Generic Linux (Architecture Independent), mysql-5.6.17.tar.gz
        http://dev.mysql.com/downloads/mysql/

        #源碼安裝方式官方網站鏈接:http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html

        2、系統需求
        Source Installation System Requirements

        Installation of MySQL from source requires several development tools. Some of these tools are needed no matter whether you use a standard source distribution or a development source tree. Other tool requirements depend on which installation method you use.

        To install MySQL from source, your system must have the following tools, regardless of installation method:

        a、CMake, which is used as the build framework on all platforms. CMake can be downloaded fromhttp://www.cmake.org.

        b、A good make program. Although some platforms come with their own make implementations, it is highly recommended that you use GNU make 3.75 or newer. It may already be available on your system as gmake. GNU make is available fromhttp://www.gnu.org/software/make/.

        c、A working ANSI C++ compiler. GCC 4.2.1 or later, Sun Studio 12 or later, Visual Studio 2010 or later, and many current vendor-supplied compilers are known to work.

        d、Perl is needed if you intend to run test scripts. Most Unix-like systems include Perl. On Windows, you can use a version such as ActiveState Perl.

        #使用源碼安裝上面的一些開發工具是需要的,比較重要的一個是Cmake工具,通常情況下os并沒有安裝,需要手動安裝。
        #如果沒有cmake會收到這個錯誤提示:(-bash: cmake: command not found)

        3、安裝cmake
        #可以到這里下載cmake,我這里下載的是2.6.4版本
        http://www.cmake.org/cmake/resources/software.html
        SZDB:~ #cd /usr/local/src/mysql_src
        SZDB:/usr/local/src/mysql_src #tar -xvf cmake-2.6.4.tar.gz
        SZDB:/usr/local/src/mysql_src #cd cmake-2.6.4
        SZDB:/usr/local/src/mysql_src/cmake-2.6.4 #./bootstrap
        SZDB:/usr/local/src/mysql_src/cmake-2.6.4 #./make
        SZDB:/usr/local/src/mysql_src/cmake-2.6.4 #./make install

        4、安裝MySQL
        SZDB:~ #groupadd mysql
        SZDB:~ #useradd -r -g mysql mysql
        SZDB:~ #cd /usr/local/src/mysql_src
        SZDB:/usr/local/src/mysql_src #tar -xvf mysql-5.6.17.tar.gz
        SZDB:/usr/local/src/mysql_src #ls
        mysql-5.6.17 mysql-5.6.17.tar.gz
        SZDB:/usr/local/src/mysql_src #cd mysql-5.6.17/
        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #cmake .

        ..........
        -- Check size of wint_t - done
        -- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
        CMake Error at cmake/readline.cmake:85 (MESSAGE): Author : Leshami
        Curses library not found. Please install appropriate package, Blog :http://blog.csdn.net/leshami

        remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev,
        on Redhat and derivates it is ncurses-devel.
        Call Stack (most recent call first):
        cmake/readline.cmake:128 (FIND_CURSES)
        cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
        CMakeLists.txt:411 (MYSQL_CHECK_EDITLINE)

        #如果cmake期間碰到上述錯誤,應該安裝ncurses-devel rpm包,然后移除CMakeCache.txt
        -- Configuring incomplete, errors occurred!

        #如有沒有對應的os安裝光盤,可以從下面的鏈接下載這個rpm包,注意對應的版本號應一致
        http://www.filewatcher.com/m/ncurses-devel-5.5-18.11.x86_64.rpm.735840-0.html
        SZDB:/usr/local/src/mysql_src # rpm -Uvh ncurses-devel-5.5-18.11.x86_64.rpm
        Preparing... ########################################### [100%]
        1:ncurses-devel ########################################### [100%]

        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #rm -rf CMakeCache.txt
        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #cmake . #再次執行cmake

        ........
        -- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl;aio
        -- Configuring done
        -- Generating done
        -- Build files have been written to: /usr/local/src/mysql_src/mysql-5.6.17

        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #make

        Linking CXX executable mysqltest_embedded
        [100%] Built target mysqltest_embedded
        Scanning dependencies of target my_safe_process
        [100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
        Linking CXX executable my_safe_process
        [100%] Built target my_safe_process

        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #make install
        SZDB:/usr/local/src/mysql_src/mysql-5.6.17 #cd /usr/local/mysql
        SZDB:/usr/local/mysql #chown -R mysql .
        SZDB:/usr/local/mysql #chgrp -R mysql .
        SZDB:/usr/local/mysql #scripts/mysql_install_db --user=mysql

        ..........
        To start mysqld at boot time you have to copy
        support-files/mysql.server to the right place for your system

        PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
        To do so, start the server, then issue the following commands:

        ./bin/mysqladmin -u root password 'new-password'
        ./bin/mysqladmin -u root -h SZDB password 'new-password'

        Alternatively you can run:

        ./bin/mysql_secure_installation

        which will also give you the option of removing the test
        databases and anonymous user created by default. This is
        strongly recommended for production servers.

        See the manual for more instructions.

        You can start the MySQL daemon with:

        cd . ; ./bin/mysqld_safe &

        You can test the MySQL daemon with mysql-test-run.pl

        cd mysql-test ; perl mysql-test-run.pl

        New default config file was created as ./my.cnf and
        will be used by default by the server when you start it.
        You may edit this file to change server settings
        ..........

        SZDB:/usr/local/mysql #chown -R root .
        SZDB:/usr/local/mysql #chown -R mysql data
        SZDB:/usr/local/mysql #cp support-files/mysql.server /etc/init.d/mysql.server #配置自啟動
        SZDB:/usr/local/mysql #cp support-files/my-default.cnf /etc/my.cnf #添加缺省的my.cnf配置文件
        SZDB:/usr/local/mysql #bin/mysqld_safe --user=mysql & #啟動mysql
        [1] 21004
        SZDB:/usr/local/mysql # 140521 02:54:54 mysqld_safe Logging to '/usr/local/mysql/data/SZDB.err'.
        140521 02:54:54 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

        #配置環境變量,通過軟鏈或者修改環境變量實現(PATH=$PATH:/usr/local/mysql/bin/;export PATH)

        SZDB:~ #ln -fs /usr/local/mysql/bin/mysql /usr/local/bin
        SZDB:~ #ln -fs /usr/local/mysql/bin/mysqladmin /usr/local/bin
        SZDB:~ #ln -fs /usr/local/mysql/bin/mysqld_safe /usr/local/bin

        #登陸到mysql
        SZDB:/usr/local/bin #mysql -uroot
        Welcome to the MySQL monitor. Commands end with ; or /g.
        Your MySQL connection id is 1
        Server version: 5.6.17 Source distribution

        Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

        Oracle is a registered trademark of Oracle Corporation and/or its
        affiliates. Other names may be trademarks of their respective
        owners.

        Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

        mysql> show databases;
        +--------------------+
        | Database |
        +--------------------+
        | information_schema |
        | mysql |
        | performance_schema |
        | test |
        +--------------------+
        4 rows in set (0.00 sec)

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        [原]Linux下基于源碼方式安裝MySQL5.6_MySQL

        [原]Linux下基于源碼方式安裝MySQL5.6_MySQL:MySQL為開源數據庫,因此可以基于源碼實現安裝。基于源碼安裝有更多的靈活性。也就是說我們可以針對自己的硬件平臺選用合適的編譯器來優化編譯后的二進制代碼,根據不同的軟件平臺環境調整相關的編譯參數,選擇自身需要選擇不同的安裝組件,設定需要的字符集
        推薦度:
        標簽: 數據庫 linux mysql
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 免费人成动漫在线播放r18| 7777久久亚洲中文字幕| 久久99精品免费一区二区| 免费一级毛片不卡不收费| 看一级毛片免费观看视频| 亚洲av高清在线观看一区二区 | www.免费在线观看| 精品亚洲成a人片在线观看 | 国产免费av片在线看| 亚洲精品无码人妻无码| 国产精品麻豆免费版| 国产亚洲人成在线播放| 亚洲乱亚洲乱少妇无码| 国产性生大片免费观看性| 亚洲真人无码永久在线| 最近中文字幕大全免费版在线 | 亚洲精品视频专区| 黄页网站在线观看免费高清| 国产成人精品亚洲2020| 看全色黄大色大片免费久久| 色噜噜狠狠色综合免费视频| 久久国产成人精品国产成人亚洲| a级午夜毛片免费一区二区| 一区二区三区亚洲| 国产极品粉嫩泬免费观看| yellow免费网站| 亚洲午夜视频在线观看| 成年女人喷潮毛片免费播放 | 99在线免费视频| 亚洲制服在线观看| 国产免费无遮挡精品视频| 香蕉免费一级视频在线观看| 亚洲美女自拍视频| 亚洲AV无码一区二三区 | 99久久免费国产精品特黄 | XXX2高清在线观看免费视频| 亚洲国产高清视频| 日韩一级在线播放免费观看| 人妻在线日韩免费视频| 亚洲日韩国产一区二区三区在线 | 亚洲av无码乱码国产精品fc2|