MYSQL5 5原始碼安裝 linux下

2022-05-08 08:21:10 字數 2736 閱讀 8435

/* 首先安裝必要的庫 */

yum -y install gcc*

###### 安裝 mysql ######

首先安裝camke

一、支援yum,則

yum install -y cmake

二、也可以原始碼安裝

[root@localhost ~]# cd /usr/local/src

[root@localhost src]# wget

[root@localhost src]# tar zxvf cmake-2.8.7.tar.gz

[root@localhost src]# cd cmake-2.8.7

#安裝cmake

[root@localhost cmake-2.8.7]# ./configure

[root@localhost cmake-2.8.7]# make

[root@localhost cmake-2.8.7]# make install

/* 安裝 mysql

*/安裝

[root@localhost ~]# groupadd mysql

[root@localhost ~]# useradd -g mysql mysql

[root@localhost ~]# tar zxvf mysql-5.2.25.tar.gz

[root@localhost ~]# cd mysql-5.2.25

/* #cmake . //預設情況下安裝,安裝目錄為/usr/local/mysql 資料目錄為/usr/local/mysql/data

#也可以指定引數安裝,如指定utf8,資料引擎等

#具體參照 ... ration-options.html

*/[root@localhost mysql-5.2.25]# cmake -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/mysql/data -ddefault_charset=utf8 -ddefault_collation=utf8_general_ci -dwith_extra_charsets:string=all -dwith_debug=0 -dwith_ssl=yes -dwith_readline=1 -denabled_local_infile=1

[root@localhost mysql-5.2.25]# make && make install

[root@localhost mysql-5.2.25]# cd /usr/local/mysql

[root@localhost mysql]# chown -r mysql:mysql /usr/local/mysql

[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql -datadir=/mysql/data

#此處如不指定datadir,到啟動時會報錯

[root@localhost mysql]# chown -r root .

[root@localhost mysql]# chown -r mysql data

[root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf

[root@localhost mysql]# ./bin/mysqld_safe --user=mysql &

# next command is optional

[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld

[root@localhost mysql]# chmod +x /etc/init.d/mysqld

[root@localhost mysql]# /etc/init.d/mysqld start

到此,安裝完成

此處安裝會遇到的錯誤!!

報錯如下:

-- could not find curses (missing: curses_library curses_include_path)

cmake error at cmake/readline.cmake:82 (message):

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:126 (find_curses)

cmake/readline.cmake:216 (mysql_use_bundled_libedit)

cmakelists.txt:250 (mysql_check_readline)

--〉解決方法:

[root@localhost mysql-5.6.1]# rm cmakecache.txt

[root@localhost mysql-5.6.1]# yum install ncurses-devel

[root@localhost mysql-5.5.11]# yum install bison

接著繼續執行編譯

#cmake......

#make && make install

原始碼安裝mysql5 5

原始碼編譯安裝 mysql 5.5.13 實踐 1.安裝cmake mysql從5.5版本開始,通過.configure進行編譯配置方式已經被取消,取而代之的是cmake工具。因此,我們首先要在系統中原始碼編譯安裝cmake工具。wget tar zxvf cmake 2.8.7.tar.gz cd...

Linux 原始碼安裝Mysql5 5

公司的伺服器是centos 5.4 final 版的,今天在上面安裝了一回mysql5.5,記錄如下 2 tar zxvf mysql 5.5.2 m2.tar.gz 解壓到 usr local src mysql 5.5.2 m2下 cd mysql 5.5.2 m2 configure pref...

mysql5 5 原始碼分析( )

做個備份,好記性不如爛筆頭。sloccount算了一下,整個工程的 是百萬行級的,c 和ascic為主。從規模來看,絲毫不遜色於wps文字。時隔一年半,再把c 撿起來。cpp 631203 49.60 ansic 543818 42.74 507268 storage cpp 352539,ansi...