本篇內(nèi)容主要給大家講解一下如何在linux下安裝MYSQL數(shù)據(jù)庫,并以安裝MYSQL5.6版本為例子教給大家進(jìn)行登錄用戶名和密碼的修改等操作。
源碼下載地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads
tar.gz地址:https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.37.tar.gz

選擇Generic Linux (Architecture Independent), Compressed TAR Archive

選擇 No thanks, just start my download. 開始下載

操作系統(tǒng):
centos6.5 x86_64
一、yum安裝相關(guān)依賴
# yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake bison git openssl openssl-devel
二、編譯安裝
1.添加用戶
groupadd mysql
useradd -r -g mysql mysql
2.編譯安裝
tar xf mysql-5.6.34.tar.gz
cd mysql-5.6.34
#默認(rèn)情況下是安裝在/usr/local/mysql
# cmake編譯參數(shù)可以自己調(diào)整
| ************************************************************** -- Looking for asprintf -- Looking for asprintf - found -- Check size of pthread_t -- Check size of pthread_t - done -- Using cmake version 2.8.12.2 -- Not building NDB -- Performing Test HAVE_PEERCRED -- Performing Test HAVE_PEERCRED - Success -- Library mysqlclient depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl -- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source. -- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80 -- Library mysqlserver depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl;crypt -- CMAKE_BUILD_TYPE: RelWithDebInfo -- COMPILE_DEFINITIONS: HAVE_CONFIG_H -- CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement -- CMAKE_CXX_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project: WITH_READLINE -- Build files have been written to: /root/mysql-5.6.34 |
**************************************************************
cmake編譯報錯需要刪除編譯緩存,修復(fù)錯誤后再次重新編譯
新聞熱點
疑難解答
圖片精選