Mysql实例安装、配置

1、Mysql安装

准备工作

首先是单实例安装,也就是一台服务器上就装一个mysql,多实例安装就是在一个服务器上安装2个甚至多个mysql。
linux配置信息如下:
在这里插入图片描述

单实例安装

1、新建soft文件夹,将mysql安装文件上传到该路径下,并复制到/usr/local 路径下
cp /soft/mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz /usr/local/
2、解压 mysql 到/usr/local 目录
tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz
在这里插入图片描述
3、INSTALL-BINARY:官方安装推荐文档。
在这里插入图片描述
安装需要的依赖
yum install -y libaio
具体安装
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz
shell> ln -s /usr/local/mysql-5.7.9-linux-glibc2.5-x86_64 mysql
shell> cd mysql
shell> mkdir mysql-files
shell> chmod 770 mysql-files
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up
ycekpvlH>43e
shell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and up
shell> chown -R root .
shell> mkdir data
shell> chown -R mysql data mysql-files
/usr/local/mysql/bin/mysqld --verbose --help|grep -A 1 ‘Default options’
shell> bin/mysqld_safe --user=mysql & # Next command is optional
在这里插入图片描述
Mysql已经启动成功
在这里插入图片描述
shell> cp support-files/mysql.server /etc/init.d/mysql.server
配置环境变量:
Vi /etc/profile
export PATH=/usr/local/mysql/bin:$PATH
source /etc/profile
配置开启启动
chkconfig mysql.server on
chkconfig --list
登陆,修改密码
mysql -uroot -p ‘ycekpvlH>43e’
set password = ‘root1234%’;
允许远程登陆
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘root1234%’ WITH GRANT OPTION;
flush privileges;

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值