华为泰山鲲鹏920(CentOS7/openEuler)支持MySQL5.6
Posted 闭关苦炼内功
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为泰山鲲鹏920(CentOS7/openEuler)支持MySQL5.6相关的知识,希望对你有一定的参考价值。
mysql5.6
# 1. 依赖安装
yum -y install gcc gcc-c++ libaio*
# 2. 添加mysql用户组和mysql用户,用于隔离mysql进程
groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
# 3. 下载解压MySQL安装包
[root@arm ~]# wget http://decs.pcl.ac.cn:3731/mirrors/software/MySQL/linux-version/aarch64/mysql5.6/mysql-5.6.44-aarch64.tar.gz
[root@arm ~]# tar -xzvf mysql-5.6.44-aarch64.tar.gz -C /usr/local/
[root@arm ~]# rm -rf mysql-5.6.44-aarch64.tar.gz
# 4. 配置MySQL
[root@arm ~]# mv /usr/local/mysql-5.6.44-aarch64 /usr/local/mysql
[root@arm ~]# chown -R mysql:mysql /usr/local/mysql
[root@arm ~]# rm –rf /etc/my.cnf
[root@arm ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
[root@arm ~]# vi /etc/my.cnf
[mysqld]
...
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
...
# 设置开机启动
[root@arm ~]# cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@arm ~]# chmod +x /etc/init.d/mysqld
[root@arm ~]# systemctl enable mysqld
# 5. 添加Mysql环境变量
[root@arm ~]# vi /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
[root@arm ~]# source /etc/profile
# 6. 初始化Mysql
[root@arm ~]# cd /usr/local/mysql
[root@arm mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
# 7. 启动登录mysql
[root@arm mysql]# systemctl enable mysqld
[root@arm mysql]# systemctl start mysqld
# 查看状态
[root@arm mysql]# systemctl status mysqld
# 默认密码为空
[root@arm mysql]# mysql -uroot -p
# 修改密码
[root@arm mysql]# /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
welcome to visit my blog -> https://qchenz.blog.csdn.net/
以上是关于华为泰山鲲鹏920(CentOS7/openEuler)支持MySQL5.6的主要内容,如果未能解决你的问题,请参考以下文章
华为鲲鹏920云主机部署zookeeper集群(3.6.3版本)