安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64

安装mysqlmysql-5.7.24-linux-glibc2.12-x86_64,第1张

概述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下新建

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下新建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/MysqLd.log
pID-file=/opt/MysqL/data/MysqLd.pID

#
# 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

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

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

6、

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

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

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

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

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

8、./MysqLd_safe --user=MysqL &

9、./MysqL -u root -p

输入初始密码

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

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

12、flush privileges;

13、set global show_compatibility_56=on;

14、MysqL> quit;

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

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

 

 

参考:

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

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

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

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

总结

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

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/1023069.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存