CentOS 6.5 源碼安裝MySQL5.6

來源:互聯網
上載者:User

標籤:plain   move   library   not   mysql使用者   sts   mysql的安裝   啟動mysql   post   

1:下載安裝cmake (mysql5.5以後是通過cmake來編譯的)

123456789101112131415161718 #http://download.csdn.net/detail/csxuedn/7976005 #wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz # tar -zxv -f /root/cmake-2.8.4.tar.gz# cd cmake-2.8.4#./configureError when bootstrapping CMake:Cannot find appropriate C++ compiler on this system.Please specify one using environment variable CXX.See cmake_bootstrap.log for compilers attempted.       #yum install gcc-c++ #./configure# make && make install

  

2:建立mysql的安裝目錄及資料庫存放目錄

12 #mkdir -p /gechong/mysql                 //安裝mysql#mkdir -p /gechong/mysql/data            //存放資料庫

  

3:建立mysql使用者及使用者組

1 #groupadd mysql
1 #useradd -g mysql -s /bin/false -M mysql

  

4:安裝mysql

1 #wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.21.tar.gz

[[email protected] gechong]# ls
mysql

[[email protected] gechong]# pwd
/gechong

1  

[[email protected] gechong]# tar -zxv -f /root/mysql-5.6.21.tar.gz

[[email protected] gechong]# cd mysql-5.6.21/

編譯:

1234567 cmake . \-DCMAKE_INSTALL_PREFIX=/gechong/mysql \-DMYSQL_DATADIR=/gechong/mysql/data \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DEXTRA_CHARSETS=all \-DENABLED_LOCAL_INFILE=1

 

報錯了:

1234567891011 CMake Error at cmake/readline.cmake:85 (MESSAGE):  Curses library not found.  Please install appropriate package,       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:427 (MYSQL_CHECK_EDITLINE)  -- Configuring incomplete, errors occurred!

 

1 #yum -y install ncurses-devel

 

1 #rm -f CMakeCache.txt

  

重新編譯:

# make clean

# rm -f CMakeCache.txt

# rm -rf /etc/my.cnf

1234567 cmake . \-DCMAKE_INSTALL_PREFIX=/gechong/mysql \-DMYSQL_DATADIR=/gechong/mysql/data \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DEXTRA_CHARSETS=all \-DENABLED_LOCAL_INFILE=1

 

1 #make && make install

 很慢。。。等著吧

 

5:配置MySQL

1 # cd /gechong/mysql<br># chown -R root:mysql .<br># chown -R mysql:mysql data

  

6:

1 # cp support-files/my-default.cnf /etc/my.cnf

  

7:初始化許可權表

1 #scripts/mysql_install_db --user=mysql

  

8:啟動MySQL服務

123 #ln -s /gechong/mysql/bin/mysql /usr/bin #service mysqld start 

 

10:之後空使用者登陸MySQL,刪除空使用者,對使用者賦許可權。

http://blog.csdn.net/langeldep/article/details/6223649

CentOS 6.5 源碼安裝MySQL5.6

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.