1、 useradd -r mysql
2、 mkdir -p /data/mysql
3、chown -R mysql.mysql /data/mysql
4、tar xvzf zabbix-2.4.2.tar.gz -C /usr/local/
5、ln -s mysql-5.6.21-linux-glibc2.5-x86_64/ mysql
6、cd mysql
7、chown -R root.mysql ./*
8、scripts/mysql_install_db --user=mysql --datadir=/data/mysql --explicit_defaults_for_timestamp
9、cp support-files/mysql.server /etc/init.d/mysqld
10、cp support-files/my-default.cnf /etc/my.cnf
11、echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf && ldconfig -v
12、ln -s /usr/local/mysql/include /usr/include/mysql
13、vi /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /data/mysql
socket = /data/mysql/mysql.sock
14、echo "export PATH=$PATH:/usr/local/mysql/bin" > /etc/profile.d/mysql.sh
15、source /etc/profile.d/mysql.sh
16、chkconfig mysqld on
17、service mysqld start
本文出自 “hanyun.fang” 博客,转载请与作者联系!
原文:http://hanyun.blog.51cto.com/1060170/1611813