华为泰山鲲鹏920(CentOS7/openEuler)支持MySQL5.6

README

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安装包
[[email protected] ~]# wget http://decs.pcl.ac.cn:3731/mirrors/software/MySQL/linux-version/aarch64/mysql5.6/mysql-5.6.44-aarch64.tar.gz
[[email protected] ~]# tar -xzvf mysql-5.6.44-aarch64.tar.gz -C /usr/local/
[[email protected] ~]# rm -rf mysql-5.6.44-aarch64.tar.gz

# 4. 配置MySQL
[[email protected] ~]# mv /usr/local/mysql-5.6.44-aarch64 /usr/local/mysql
[[email protected] ~]# chown -R mysql:mysql /usr/local/mysql  
[[email protected] ~]# rm –rf /etc/my.cnf
[[email protected] ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
[[email protected] ~]# vi /etc/my.cnf
[mysqld]
...
  basedir = /usr/local/mysql
  datadir = /usr/local/mysql/data
  port = 3306
...
# 设置开机启动
[[email protected] ~]# cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld  
[[email protected] ~]# chmod +x /etc/init.d/mysqld
[[email protected] ~]# systemctl enable mysqld

# 5. 添加Mysql环境变量
[[email protected] ~]# vi /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
[[email protected] ~]# source /etc/profile

# 6. 初始化Mysql
[[email protected] ~]# cd /usr/local/mysql
[[email protected] mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

# 7. 启动登录mysql
[[email protected] mysql]# systemctl enable mysqld
[[email protected] mysql]# systemctl start mysqld
# 查看状态
[[email protected] mysql]# systemctl status mysqld  
# 默认密码为空
[[email protected] mysql]# mysql -uroot -p
# 修改密码
[[email protected] 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.7

下二篇:-> 华为泰山鲲鹏920(CentOS7/openEuler)支持MySQL8.0

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>