标签:blog http os io 文件 数据 ar 代码
[root@localhost local]# yum -y install gcc-c++
[root@localhost local]# yum -y install ncurses-devel
[root@localhost]# tar -zxv -f cmake-2.8.10.2.tar.gz // 解压压缩包
[root@localhost local]# cd cmake-2.8.10.2
[root@localhost cmake-2.8.10.2]# ./configure
[root@localhost cmake-2.8.10.2]# make
[root@localhost cmake-2.8.10.2]# make install
用vi在文件/etc/profile文件中增加变量,使其永久有效,
[root@localhost local]# vi /etc/profile (不会用vi命令的,可以找到/etc/profile 对应文件,对文件进行编辑)
在文件末尾追加以下两行代码:
PATH=/usr/local/cmake-2.8.10.2/bin:$PATH
export PATH
执行以下代码使刚才的修改生效:
[root@localhost local]# source /etc/profile
用 export 命令查看PATH值
[root@localhost local]# echo $PATH
[root@localhost]# mkdir -p /usr/local/mysql
[root@localhost]# mkdir -p /usr/local/mysql/data //存放数据库
[root@localhost] groupadd mysql
[root@localhost] useradd -r -g mysql mysql
[root@localhost local]# tar -zxv -f mysql-5.5.21.tar.gz //解压
[root@localhost local]# cd mysql-5.5.21
[root@localhost mysql-5.5.21]#
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
[root@localhost mysql-5.5.21]# make
[root@localhost mysql-5.5.21]# make install
[root@localhost mysql-5.5.29]# cd /usr/local/mysql/
[root@localhost mysql]# ls
bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files
有bin等以上文件的话,恭喜你已经成功安装了mysql
本文摘自:http://www.cnblogs.com/zhoulf/archive/2013/01/25/zhoulf.html
Centos 安装 mysql,布布扣,bubuko.com
标签:blog http os io 文件 数据 ar 代码
原文地址:http://www.cnblogs.com/Jenny-sider/p/3907069.html