mysql56自定义安装图解_Mysql 5.5.56版本(二进制包安装)自定义安装路径步骤记录...

安装路径:/application/mysql-5.5.56

1.前期准备

mysql依赖

libaio

yum install -y libaio

创建用户mysql,以该用户的身份执行mysql

useradd -s /bin/false -M mysql

下载mysql二进制包并解压

cd /tools

wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

tar -zxf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz -C /application/

切换到/application目录,将mysql文件夹名改短,给mysql目录做一个软链接

cd /application/

mv mysql-5.5.56-linux-glibc2.5-x86_64/ mysql-5.5.56

ln -s mysql-5.5.56/ mysql

递归设置mysql目录的所属组和所属用户

chown -R mysql:mysql mysql-5.5.56/

2.mysql目录内操作

cd mysql

初始化数据库

会在mysql目录内生成一个data目录,存放数据库的目录

./scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql

更改所属用户和组

chown -R root .

chown -R mysql data

除了mysql目录下的data目录所属用户不变,其他所有文件的所属用户改为root

拷贝配置文件

cp support-files/my-medium.cnf /etc/my.cnf

将mysql的配置文件拷贝为/etc/目录下的my.cnf

修改配置文件

sed -i 28i'log-error=/application/mysql/data/mysqld.error' /etc/my.cnf

在配置文件插入了一行,进行配置错误日志

/etc/my.cnf Content:

# Example MySQL config file for medium systems.

#

# This is for a system with little memory (32M - 64M) where MySQL plays

# an important part, or systems up to 128M where MySQL is used together with

# other programs (such as a web server)

#

# MySQL programs look for option files in a set of

# locations which depend on the deployment platform.

# You can copy this option file to one of those

# locations. For information about these locations, see:

# http://dev.mysql.com/doc/mysql/en/option-files.html

#

# In this file, you can use all long options that a program supports.

#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值