小小dba一枚
2015年(4)
分类: mysql/postgresql
2015-03-06 06:07:24
安装编译源码所需要的工具包
shell >> yum install gcc gcc-c ncurses-devel perl
安装编译工具cmake
shell >> wget
shell >> tar -zxvf cmake-2.8.10.2.tar.gz
shell >> cd cmake-2.8.10.2
shell >> ./bootstrap;make;make install
创建mysql 用户、用户组
shell >> groupadd mysql
shell >> useradd -g mysql mysql
shell >> mkdir /usr/local/mysql
cmake
\
-dcmake_install_prefix=/usr/local/mysql
\
-dmysql_datadir=/usr/local/mysql/data \
-dsysconfdir=/etc \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1
\
-dmysql_unix_addr=/var/lib/mysql/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-dwith_partition_storage_engine=1 \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
make && make install
chown -r mysql.mysql /opt/mysql/mysql56
根据自己需求修改配置文件
./scripts/mysql_install_db --defaults-file=/etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
shell >> vim /etc/profile
添加 path=/usr/local/mysql/bin:$path
export path
shell >> source /etc/profile
shell >> mysqld_safe --defaults-file=/etc/my.cnf --start
shell >> chkconfig list |grep mysql
shell >> chkconfig mysql off
shell >> ps aux|grep mysql
shell >> mysql -uroot
mysql >> set password = password(****);