Mysql必读linux下使用RPM安装mysql5.7.17

Mysql必读linux下使用RPM安装mysql5.7.17,第1张

概述介绍《Mysql必读linux下使用RPM安装mysql5.7.17》开发教程,希望对您有用。

《MysqL必读linux下使用RPM安装MysqL5.7.17》要点:
本文介绍了MysqL必读linux下使用RPM安装MysqL5.7.17,希望对您有用。如果有疑问,可以联系我们。

linux下MysqL5.7 rpm安装方式记录,供大家参考,具体内容如下MysqL必读

删除旧包:MysqL必读

# rpm -qa | grep -i MysqL# rpm -ev MysqL-libs-* --nodeps

安装rpm包:MysqL必读

# rpm -ivh MysqL-community-common-5.7.17-1.el7.x86_64.rpm# rpm -ivh MysqL-community-libs-5.7.17-1.el7.x86_64.rpm# rpm -ivh MysqL-community-clIEnt-5.7.17-1.el7.x86_64.rpm# rpm -ivh MysqL-community-server-5.7.17-1.el7.x86_64.rpm

启动、停止:MysqL必读

# service MysqLd start# service MysqLd stop# service MysqLd status

初始随机密码:MysqL必读

# cat /var/log/MysqLd.log | more

修改初始密码及授权远程访问:MysqL必读

# MysqL -uroot -pMysqL> set password='Pwd@123456';MysqL> grant all privileges on *.* to 'root'@'%' IDentifIEd by 'Pwd@123456';

密码复杂度属性:MysqL必读

MysqL> set global valIDate_password_policy=0;

valIDate_password_policy有以下取值:(默认是1,即MEDIUM,所以刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符.)MysqL必读

MysqL必读

修改数据目录:MysqL必读

 新目录需要给MysqL用户授权,MysqLd_safe日志文件授权,关闭selinux(没找到相关策略设置的方法)MysqL必读

# mkdir /data/MysqL/data# mv /var/lib/MysqL/* /data/MysqL/data/# mkdir /data/MysqL/log# chown MysqL:MysqL -R /data/MysqL# touch MysqLd_safe.log# chown MysqL:MysqL MysqLd_safe.log# vi /etc/my.cnf/**[clIEnt]port = 3306socket = /data/MysqL/log/MysqL.sockdefault-character-set=utf8[MysqL]no-auto-rehashsocket=/data/MysqL/log/MysqL.sockdefault-character-set=utf8[MysqLd]port = 3306socket = /data/MysqL/log/MysqL.sockcharacter-set-server=utf8lower_case_table_names=1basedir=/usrdatadir=/data/MysqL/datalog-error=/data/MysqL/log/error.logpID-file=/data/MysqL/log/MysqL.pIDinit_connect='SET nameS utf8'symbolic-links=0skip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8M[MysqLd_safe]log-error=/data/MysqL/log/MysqLd_safe.log*/# getenforceEnforcing# setenforce 0# vi /etc/selinux/config/**# This file controls the state of SElinux on the system.# SEliNUX= can take one of these three values:#   enforcing - SElinux security policy is enforced.#   permissive - SElinux prints warnings instead of enforcing.#   Disabled - No SElinux policy is loaded.#SEliNUX=enforcingSEliNUX=Disabled# SEliNUXTYPE= can take one of these two values:#   targeted - Targeted processes are protected,#   mls - Multi Level Security protection.SEliNUXTYPE=targeted */# service MysqLd start

其他命令:MysqL必读

# MysqLadmin -u root -p passwordMysqL> select version();# chkconfig --List# chkconfig --level 345 MysqLd on# netstat -na | grep 3306

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持内存溢出PHP.MysqL必读

总结

以上是内存溢出为你收集整理的Mysql必读linux下使用RPM安装mysql5.7.17全部内容,希望文章能够帮你解决Mysql必读linux下使用RPM安装mysql5.7.17所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/sjk/1162452.html

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

发表评论

登录后才能评论

评论列表(0条)

保存