数据库
首页 > 数据库> > mysql5.6 安装部署

mysql5.6 安装部署

作者:互联网

mysql5.6 install

这里以预编译二进制方式安装部署,与编译安装相比,不需要编译,直接修改好my.cnf初始化后即可使用,推荐生产环境使用这种方式。

cd ~
wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
cat /etc/my.cnf
[client]
port = 3306
socket = /data/coohua/mysql/mysql.sock
default-character-set = utf8

[mysqld]
port = 3306
socket = /data/coohua/mysql/mysql.sock
basedir = /app/3rd/mysql/mysql
datadir = /data/coohua/mysql/data/
pid-file = /data/coohua/mysql/data/mysqld.pid
user = mysql
character-set-server =utf8
innodb_large_prefix=on
lower_case_table_names = 1
server-id = 1
groupadd mysql
useradd -g mysql -M -s /sbin/nologin mysql 
mkdir -p /app/3rd/mysql
mkdir -p /data/coohua/mysql
tar -zxf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz -C /app/3rd/mysql/
ln -s /app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64  /app/3rd/mysql/default
chown -R mysql.mysql /app/3rd/mysql #程序目录
chown -R /data/coohua/mysql/    #数据目录
cd /app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64
./scripts/mysql_install_db --defaults-file=/app/3rd/mysql/default/my.cnf   --user=mysql
please install the following Perl modules before executing scripts/mysql_install_db:

缺少autoconf
yum -y install autoconf

error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

缺少libaio

yum install -y libaio
./scripts/mysql_install_db --defaults-file=/app/3rd/mysql/default/my.cnf   --user=mysql
/app/3rd/mysql/default/bin/mysqld_safe --defaults-file=/app/3rd/mysql/default/my.cnf  --user=mysql &  
./bin/mysqladmin  -S /tmp/mysql.sock -u root -h localhost password 'root' 
mysql -S /tmp/mysql.sock -uroot -hlocalhost -proot 
delete from mysql.user where password=''; #删除无密码用户
drop database test; #删除test数据库

至此mysql5.6版本已经安装完毕,但仅仅是安装完毕,后续要的优化很多

标签:3rd,部署,data,app,mysql5.6,default,install,mysql,安装
来源: https://blog.51cto.com/9095441/2442965