赞
踩
MySQL官网: https://www.mysql.com/downloads/
将MySQL压缩文件移动到自己心仪的位置
mv mysql-8.3.0-linux-glibc2.28-x86_64.tar.xz /usr/local/etc
tar -xvf mysql-8.3.0-linux-glibc2.28-x86_64.tar.xz
mv mysql-8.3.0-linux-glibc2.28-x86_64 mysql-8.3.0
rm -i mysql-8.3.0-linux-glibc2.28-x86_64.tar.xz
sudo groupadd mysql
sudo useradd -r -g mysql mysql
groups mysql
vi /usr/local/etc/mysql-8.3.0/support-files/mysql.serve
vi /usr/local/etc/mysql-8.3.0/mini.conf
[mysqld]
basedir=/usr/local/etc/mysql-8.3.0
datadir=/usr/local/etc/mysql-8.3.0/data
port=3306
socket=/tmp/mysql.sock
character_set_server=utf8
lower_case_table_names=1
log-error=/usr/local/etc/mysql-8.3.0/data/mysql.log
pid-file=/usr/local/etc/mysql-8.3.0/data/mysql.pid
[mysql]
default-character-set = utf8
vi etc/profile
# setting MySQL environment
MYSQL_HOME=/usr/local/etc/mysql-8.3.0
PATH=$PATH:$MYSQL_HOME/bin
export MYSQL_HOME PATH
source etc/profile
mysqld --initialize --console
# 密码是上面的初始密码,还有就是来自小白提醒:Linux上输入密码是不显示,不动的,不要惊慌,电脑没问题
mysql -u root -p
# 进入MySQL Server所在文件夹
cd /usr/local/etc/mysql-8.3.0/support-files/
# 开启MySQL服务
./mysql.server start
set password for root@localhost='password';
# mysql默认本地连接访问,不允许外地访问 ‘%’ ip address
use mysql
update user set host='%' where user='root';
flush privileges;
# 开放端口
firewall-cmd --add-port=3306/tcp –permanent
# 重启端口
Firewall-cmd --reload
# 查看端口
firewall-cmd --list-port
不成功可以恢复快照多安装几次,再不行,就在找解决办法吧!因为小白已经解决问题了,其他的我也就不知道了,不是吗?求谅解!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。