赞
踩
安装依赖
sudo yum install -y libatomic
解压mysql
tar xvf mysql-5.7.27-aarch64.tar.gz -C /user/local
mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
替换老版本gcc
cp /usr/local/mysql/extra/libstdc++.so.6.0.24 /usr/lib64
cd /usr/lib64
rm libstdc++.so.6
ln -s libstdc++.so.6.0.24 libstdc++.so.6
配置
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/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
vim /etc/profile.d/my_env.sh
# MYSQL_HOME
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
source /etc/profile
systemctl enable mysqld
sudo mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
systemctl start mysqld
systemctl status mysqld
解决:
1. 设置无密码登陆:
`sudo vim /etc/my.cnf `
添加:`skip-grant-tables`
保存后重启服务: `systemctl restart mysql` 1. 登陆mysql后,先把密码设置为空 `mysql -uroot -p` ``` use mysql; update user set authentication_string='' where user='root'; quit; ``` 2. 重新使用密码登陆 `sudo vim /etc/my.cnf ` 注释或删除:`#skip-grant-tables` `systemctl restart mysql` 登陆root账号,由于设置了密码,可以直接敲回车进入mysql ``` ALTER USER 'root'@'localhost' IDENTIFIED BY '您的密码'; quit; ```
或者
wget https://dev.mysql.com/get/mysql84-community-release-el7-1.noarch.rpm
`# wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm #安装会报错,8以下版本没有aarch64版本的`
安装repo
sudo yum -y localinstall mysql84-community-release-el7-1.noarch.rpm
安装工具
sudo yum -y install yum-utils
安装mysql
sudo yum -y install mysql-community-server mysql
运行
systemctl start mysqld
查看初始密码
sudo cat /var/log/mysqld.log
登陆root账户
mysql -uroot -p
修改root密码
必须要先修改初始密码,才能进行后续的操作,mysql的密码要求比较高,目前知道 大写字母+小写字母+特殊字符可以过
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
FLUSH PRIVILEGES;
解决:
在连接地址后面加上:?useSSL=false&serverTimezone=UTC
解决:
在连接地址后面加上:allowPublicKeyRetrieval=true
备用方案:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Hlgj832411.';
## 刷新权限
FLUSH PRIVILEGES;
解决: mysql8改变量名称了,使用validate_password.policy
去设置
set global validate_password.policy=0;
*查看变量名称*
`SHOW VARIABLES LIKE 'validate_password%';`
sudo systemctl stop mysqld
sudo yum remove mysql mysql-server
sudo rm -rf /var/lib/mysql/
sudo rm /etc/my.cnf
sudo find / -name 'mysql*' -exec rm -rf {} \;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。