广告
返回顶部
首页 > 资讯 > 数据库 >mysql 5.7数据库安装部署
  • 367
分享到

mysql 5.7数据库安装部署

2024-04-02 19:04:59 367人浏览 八月长安
摘要

一、安装依赖环境: yum -y install libaio libaio-devel libtool make automake autoconf nuMactl numactl-devel bz

一、安装依赖环境:

yum -y install libaio libaio-devel libtool make automake autoconf nuMactl numactl-devel bzip2 GCc gcc-c++ perl perl-DBI perl-ExtUtils-MakeMaker perl-devel perl-Time-HiRes perl-DBD-Mysql pcre-devel time jemalloc gperf cmake zlib-devel openssl-devel readline-devel readline glib2-devel mysql-devel qpress which netstat

wget  Http://repositories.voole.com/jemalloc-4.0.4.tar.bz2
tar xjf jemalloc-4.0.4.tar.bz2
cd jemalloc-4.0.4
./autogen.sh
make && make install
echo '/usr/local/lib' >> /etc/ld.so.conf.d/local.conf
ldconfig

二、下载二进制包并部署:
cd /opt/soft
wget  http://repositories.voole.com/Percona-Server-5.7.21-20-linux.x86_64.ssl101.tar.gz
tar zxvf Percona-Server-5.7.21-20-Linux.x86_64.ssl101.tar.gz
mv Percona-Server-5.7.21-20-Linux.x86_64.ssl101 /usr/local/mysql

三、创建mysql用户组
groupadd mysql && useradd -g mysql -M -s /sbin/nologin mysql

四、创建数据库文件my.cnf ,统一放到程序目录里
mv /etc/my.cnf /etc/my.cnf.bak
SSD固态盘:wget  http://repositories.voole.com/my57_19.cnf  -O /etc/my.cnf
SATA磁盘:wget  http://repositories.voole.com/my57_19_sata.cnf  -O /etc/my.cnf
从库:wget  http://repositories.voole.com/my_slave.cnf  -O /etc/my.cnf
主库:wget  http://repositories.voole.com/my_master.cnf  -O /etc/my.cnf

五、初始化,记得加上配置文件
/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --initialize

六、设置环境变量
echo "export PATH=/usr/local/mysql/bin:$PATH">>/etc/profile && source /etc/profile
which mysql

七、修改属主属组
chown -R mysql.mysql /opt/mysql_data

八、启动mysql5.7服务
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
/etc/init.d/mysql start

九、重置密码(mysql5.7和其他版本不同、初次安装会生成一个随机密码在/opt/mysql_data/logerr.err日志内)
密码在logerr.err 中会默认生成一个

set passWord=password('123456');
如果需要再次修改root密码
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';

十、设置访问权限

grant all on  .  to root@"%" identified by "mysql*()";


您可能感兴趣的文档:

--结束END--

本文标题: mysql 5.7数据库安装部署

本文链接: https://www.lsjlt.com/news/47833.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作