mysql繁衍。。percona 二进制数据库的安装配置。
一、解压
tar xvf /root/Percona-Server-5.5.13-rel20.4-138.Linux.x86_64.tar.gz -C /usr/src/
mv /usr/src/Percona-Server-5.5.13-rel20.4-138.Linux.x86_64/ /usr/local/mysql二、创建mysql系统用户
groupadd mysql
useradd -g mysql mysql三、初始化
[root@slave mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/
四、授权
[root@slave mysql]# chown mysql:mysql ./* -R
五、拷贝配置文件
[root@slave mysql]# cp support-files/my-medium.cnf /etc/my.cnf
[root@slave mysql]# vim /etc/my.cnf- [mysqld]
- port = 3306
- socket = /tmp/mysql.sock ----------在这行下面添加以下内容-----------------
- datadir = /usr/local/mysql/data
- user = mysql
- basedir = /usr/local/mysql
- pid-file = /usr/local/mysql/mysql.pid
- log_bin_trust_function_creators=1
- character_set_server = utf8
六、拷贝启动脚本并授权
[root@slave mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@slave mysql]# chmod 755 /etc/init.d/mysqld[root@slave mysql]# vim /etc/init.d/mysqld (修改路径)
- mysqld_pid_file_path=
- if test -z "$basedir"
- then
- basedir=/usr/local/mysql
- bindir=/usr/local/mysql/bin
- if test -z "$datadir"
- then
- datadir=/usr/local/mysql/data
- fi
- sbindir=/usr/local/mysql/bin
- libexecdir=/usr/local/mysql/bin
- else
- bindir="$basedir/bin"
- if test -z "$datadir"
- then
- datadir="$basedir/data"
- fi
- sbindir="$basedir/sbin"
- libexecdir="$basedir/libexec"
- fi
七、启动
[root@slave mysql]# /etc/init.d/mysqld start ----------启动服务
[root@slave mysql]# ./bin/mysql ----------进入数据库