Linux MySQL5.6.36安装手册

1 安装依赖包

yum -y install perl perl-devel

2 新建用户组合用户

groupadd mysql
useradd mysql -g mysql

3 解压到data下面

mkdir /data
tar -zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz -C /data

4 重命名

cd /data
mv mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz  mysql

5 安装

cd/data/mysql

初始化安装

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

出现以下报错解决方法:

WARNING: The host 'MySQL' could not be looked up with /data/mysql/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables.../data/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

添加IP对应的主机名

vim /etc/hosts

以及安装依赖关系libaia文件

yum install libaio* -y

6 更改所有者

su root
chown -R mysql:mysql /data/mysql
cd /data/mysql/support-files/
cp my-default.cnf /etc/my.cnf
cp mysql.server /etc/init.d/mysqld

7 设置环境变量

echo 'PATH=/data/mysql/bin/:$PATH' >>/etc/profile
source /etc/profile

8 添加用户并授权

修改root本地登陆密码

set password=PASSWORD(‘vv@122’);
grant all privileges on *.* to ‘vv’@'%' identified by 'vv@122';
flush privileges;

9设置开机自启动

chkconfig --add mysqld

转载于:https://www.cnblogs.com/qiming0322/p/10132376.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值