arm64架构的Linux安装mysql5.7
arm64架构的Linux安装mysql5.7
1.添加mysql用户组和mysql用户,用于隔离mysql进程
groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
2.安装依赖库
yum install -y libaio*
3.下载解压Mysql
wget https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
tar -xvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
4.配置Mysql
mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
mkdir -p /usr/local/mysql/logs
chown -R mysql:mysql /usr/local/mysql
ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
cp -rf /usr/local/mysql/extra/lib* /usr/lib64/
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6
5.设置开机启动
cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
systemctl enable mysqld
6. 添加环境变量
vi /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=
P
A
T
H
:
PATH:
PATH:MYSQL_HOME/bin
source /etc/profile
7. 初始化启动mysql
mkdir /usr/local/mysql/data
chown -R mysql:mysql /usr/local/mysql/data
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
systemctl start mysqld
systemctl status mysqld
8 设置数据库root的密码
mysql_secure_installation
9.登陆mysql
/usr/local/mysql/bin/mysql -u root -p
10.修改远程连接
show databses;
use mysql;
select user,host from user;
update user set host=‘%’ where user = ‘root’;
flush privileges;
select user,host from user;
注意:数据库设置区分大小写,配置如下:
查看大小写信息
show variables like ‘%case_table%’;
其中
lower_case_table_names=1(1为不区分)
lower_case_table_names=0(0为区分大小写)
更多推荐
所有评论(0)