mysql的安裝

來源:互聯網
上載者:User

標籤:mysql的安裝

分類: Mysql/postgreSQL


CentOS6.3源碼安裝mysql-5.5.27

#mysql5.5以上使用cmake代替configure編譯,首先需要安裝cmake

yum install cmake

# 建mysql使用者和組

shell> groupadd mysql

shell> useradd -r -g mysql mysql

# 解壓tgz包,編譯mysql

shell> tar zxvf mysql-5.5.27.src.tar.gz

shell> cd mysql-5.5.27

shell> cmake .

shell> make && make install

# 編譯結束

# 更改使用者和組屬性,執行mysql_install_db初始化資料庫

shell> cd /usr/local/mysql

shell> chown -R mysql:mysql .

shell> scripts/mysql_install_db --user=mysql

shell> chown -R root .

shell> chown -R mysql data

# (以下命令可選)拷貝設定檔到/etc目錄下,啟動mysql

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> bin/mysqld_safe --user=mysql &

# (以下命令可選)設定mysql開機自啟動

shell> cp support-files/mysql.server /etc/init.d/mysql.server

安裝過程並不順利,遇到好幾次錯誤

1.沒有安裝 gcc 和 gcc-c++,執行cmake報如下錯誤:

==================================================

[[email protected] mysql-5.5.27]# cmake .

-- The C compiler identification is unknown

-- The CXX compiler identification is unknown

CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.

CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

.

.

.

-- Configuring incomplete, errors occurred!

==================================================

解決方案:安裝gcc和gcc-c++

yum install gcc

yum install gcc-c++

#刪除cache檔案,不刪除還會報錯

rm CMakeCache.txt 

cmake .

2.編譯快結束時,又報如下錯誤:

Warning: Bison executable not found in PATH

解決方案:安裝bison

yum install bison

rm CMakeCache.txt 

cmake .

#編譯通過

make && make install

#執行時間比較長

3.無法啟動mysql

bin/mysqld_safe --user=mysql & 無法啟動

解決方案:

再執行一次scripts/mysql_install_db --user=mysql


 這個我也不知道為啥

-- Performing Test HAVE_PEERCRED - Success

-- Looking for include files HAVE_PAM_APPL_H

-- Looking for include files HAVE_PAM_APPL_H - not found.

-- Looking for strndup

-- Looking for strndup - found

-- Looking for event.h

-- Looking for event.h - not found

-- Configuring incomplete, errors occurred!

[[email protected] mariadb-10.0.12]# make

make: *** No targets specified and no makefile found.  Stop.

這個我也不會。。你百度看看把

本文出自 “Regex和fgrep” 部落格,請務必保留此出處http://9025736.blog.51cto.com/9015736/1545814

mysql的安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.