Linux   发布时间:2022-03-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

1、下载mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz(/opt目录) 2、tar -zxvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz 3、改名称。mv mysql-5.7.24-linux-glibc2.12-x86_64 mysql,在mysql目录下创建data目录,mkdir data 4、在/etc下新建
@H_262_18@1、下载MysqL-5.7.24-linux-glibc2.12-x86_64.tar.gz(/opt目录)

@H_262_18@2、tar -zxvf MysqL-5.7.24-linux-glibc2.12-x86_64.tar.gz

@H_262_18@3、改名称。mv MysqL-5.7.24-linux-glibc2.12-x86_64 MysqL,在MysqL目录下创建data目录,mkdir data

@H_262_18@4、在/etc下新建my.cnf。内容如下

@H_262_18@#[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

@H_262_18@[MysqLd_safe]
log-error=/var/log/MysqLd.log
pid-file=/opt/MysqL/data/MysqLd.pid

@H_262_18@#
# include all files from the config directory
#
#!includedir /etc/my.cnf.d
[client]
port = 3306
socket = /opt/MysqL/MysqL.sock
default-character-set=utf-8
[MysqLd]
#skip-grant-tables
character_set_server=utf8
init_connect=‘SET NAMES utf8‘
basedir=/opt/MysqL
datadir=/opt/MysqL/data
socket=/opt/MysqL/MysqL.sock
lower_case_table_names = 1
bind-address = 0.0.0.0
sql_mode=ONLY_FULL_GROUP_BY,StriCT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

@H_262_18@5、在/opt/MysqL下新建文件MysqL.sock。

@H_262_18@touch MysqL.sock
chown MysqL:MysqL MysqL.sock
chmod 755 MysqL.sock

@H_262_18@6、

@H_262_18@查看组和用户情况:cat /etc/group | grep MysqL
查看组和用户情况:cat /etc/passwd |grep MysqL

@H_262_18@若存在,则删除MysqL用户:userdel -r MysqL,会删除其对应的组和用户并在次查看。

@H_262_18@创建MysqL组:groupadd MysqL
创建MysqL用户:useradd -r -g MysqL MysqL
修改目录拥有者:chown -R MysqL:MysqL /opt/MysqL

@H_262_18@7、cd /opt/MysqL/bin/目录

@H_262_18@ ./MysqLd --user=MysqL --basedir=/opt/MysqL --datadir=/opt/MysqL/data --initialize(需要记住初始密码)

@H_262_18@8、./MysqLd_safe --user=MysqL &

@H_262_18@9、./MysqL -u root -p

@H_262_18@输入初始密码

@H_262_18@10、改密码:MysqL>set password=password("123456");

@H_262_18@11、MysqL>grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘;

@H_262_18@12、flush privileges;

@H_262_18@13、set global show_compatibility_56=on;

@H_262_18@14、MysqL> quit;

@H_262_18@15、cp -a /opt/MysqL/support-files/MysqL.server /etc/init.d/MysqL

@H_262_18@16、ln -s /opt/MysqL/bin/MysqL /usr/bin

@H_262_18@ 

@H_262_18@ 

@H_262_18@参

@H_262_18@https://www.cnblogs.com/songyinan/p/10093288.html

@H_262_18@https://blog.csdn.net/demored/article/details/54341246

@H_262_18@https://blog.csdn.net/eagle89/article/details/78411184

@H_262_18@https://www.jianshu.com/p/8cb0189a3278

大佬总结

以上是大佬教程为你收集整理的安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64全部内容,希望文章能够帮你解决安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。