liunx mysql5 5 原始碼安裝

2021-09-01 12:14:11 字數 4120 閱讀 8795

首先到

2)解壓cmake

#tar -zvxf cmake-2.8.7.tar.gz

3)配置編譯

#cd cmake-2.8.7

#yum -y install gcc

#yum -y install gcc-c++

#./configure

#make

#make install

2.安裝mysql

2)解壓mysql-5.5.21.tar.gz

#tar -zvxf mysql-5.5.21.tar.gz

建立資料目錄(mysql5.5預設已經沒有data目錄了)

mkdir /mysql/mysql/data

3)配置編譯

#cd mysql-5.5.21

#cmake .                             ##這個方法,安裝路徑預設

或#cmake . \

-dcmake_build_type:string=release \

-dcmake_install_prefix:path=/mysql/mysql \

-dcommunity_build:bool=on \

-denabled_profiling:bool=on \

-denable_debug_sync:bool=off \

-dinstall_layout:string=standalone \

-dmysql_datadir:path=/mysql/mysql/data \

-dmysql_maintainer_mode:bool=off \

-dwith_embedded_server:bool=on \

-dwith_extra_charsets:string=all \

-dwith_ssl:string=bundled \

-dwith_unit_tests:bool=off \

-dwith_zlib:string=bundled \

-lh如果出現一下錯誤: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:256 (mysql_check_readline)

-- configuring incomplete, errors occurred!

安裝:# yum -y install ncurses-devel

#make

#make install

#groupadd mysql

#useradd -r -g mysql mysql

#cd /mysql/mysql

#chown -r mysql:mysql .

#scripts/mysql_install_db --user=mysql(./scripts/mysql_install_db --basedir/mysql/mysql/ --datadir/mysql/mysql/data/mysql  --user=mysql)

#chown -r root .

#chown -r mysql data

#cp ./support-files/my-small.cnf ./my.cnf 

#cp support-files/mysql.server mysql; chmod +x mysql

#chown -r mysql:root .

#./mysql start(./bin/mysqld_safe & )

#./bin/mysql -uroot

mysql>use mysql ;

mysql>; update user setpassword=password("123456") where user='root';

mysql>; flush privileges;

grant  許可權列表 [( 字段列表 )] on  資料庫名 . 表名 to  使用者名稱 @ 網域名稱或 ip 位址 [identified by ' 密碼 ']

eg:grant all on *.* to wuxiaoxiao@'%' identified by '870805'

錯誤解決

1)./scripts/mysql_install_db

installing mysql system tables...

101223 14:28:49 [error] ./bin/mysqld: unknown option '--skip-locking'

101223 14:28:49 [error] aborting

101223 14:28:49 [note] ./bin/mysqld: shutdown complete

由於是以前安裝過mysql ,所以存在/etc/my.cnf,而且mysql的環境變數和現在的不一樣,

從而影響 現在的,解決方法是:rm -rf /etc/my.cnf

2 )./scripts/mysql_install_db --basedir/mysql/mysql/ --datadir/mysql/mysql/data/mysql  --user=mysql

檢視原因:cat data/xcw.err

101223 15:39:18 mysqld_safe starting mysqld daemon with databases from      /w/mysqld558/data

/w/mysqld558/bin/mysqld:table'mysql.plugin' doesn't exist

101223 15:39:18 [error] can't open the mysql.plugin table. please run  mysql_upgrade to create it.

innodb: the innodb memory heap is disabled

innodb: mutexes and rw_locks use innodb's own implementation

innodb: compressed tables use zlib 1.2.3

101223 15:39:18  innodb: using linux native aio

101223 15:39:18  innodb: initializing buffer pool, size = 128.0m

101223 15:39:18  innodb: completed initialization of buffer pool

101223 15:39:18  innodb: highest supported file format is barracuda.

101223 15:39:18  innodb: 1.1.4 started; log sequence number 1588771

101223 15:39:18 [error] //mysql/mysql/bin/mysqld: unknown option '--skip-locking'

101223 15:39:18 [error] aborting

原因同上,處理也同上

3)啟動mysql服務時出現:

starting mysql.theserverquit without updating pid file (/w/mysqld558/xcw.pid).[failed]

原因是由於data沒有設定好,解決:vi mysql : datadir=/w/mysqld558 fix to datadir=/mysql/mysql/data

mysql5 5 原始碼分析( )

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

原始碼安裝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...