以下为《mysql5.7安装说明》的无排版文字预览,完整格式请下载
下载前请仔细阅读文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。
Linux下mysql5.7安装
修订历史记录
日期
文档说明
作者
备注
2020-10-23
Mysql5.7安装说明
吴某某
01. MySQL安装包某某
# cd /usr/local
2、解压
cd /usr/local #切换到安装包所在目录
tar -zxvf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
解压后:
3、给文件目录中文件移动到mysql文件夹中
mv mysql-5.7.38-linux-glibc2.12-x86_64 /usr/local/mysql
4、添加用户组和用户,并赋予权限
groupadd mysql
useradd -r -g mysql mysql
5、在根目录创建mysql数据目录,并赋予权限
mkdir -p /data/mysql
chown mysql:mysql -R /data/mysql
6、配置my.cnf
vi /etc/my.cnf
#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
#symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
#[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
bind-address=0.0.0.0
port=3306
user=mysql
basedir=/usr/local/mysql
datadir=/data/mysql
socket=/tmp/mysql.sock
log-error=/data/mysql/mysql.err
pid-file=/data/mysql/mysql.pid
#character config
character_set_server=utf8mb4
symbolic-links=0
explicit_defaults_for_timestamp=true
7、初始化数据库
切换到mysql安装目录的bin目录下
cd /usr/local/mysql/bin
./mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/ 内容过长,仅展示头部和尾部部分文字预览,全文请查看图片预览。 j2pu(标红的就是***. 开启MySQL远程访问权限
# mysql -uroot -p
Enter password:(输入上面获取的***设置root***; alter user root@'localhost' identified by 'E-tecsun!@#2022..';
###开启MySQL远程访问权限
mysql> grant all privileges on *.* to 'root'@'%' identified by 'E-tecsun!@#2022..';
###刷新权限
mysql> flush privileges;
[文章尾部最后300字内容到此结束,中间部分内容请查看底下的图片预览]
以上为《mysql5.7安装说明》的无排版文字预览,完整格式请下载
下载前请仔细阅读上面文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。