饿虎岗资源网 Design By www.oxmxm.com
linux下MySQL5.7 rpm安装方式记录,供大家参考,具体内容如下
删除旧包:
# rpm -qa | grep -i mysql # rpm -ev mysql-libs-* --nodeps
安装rpm包:
# 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
启动、停止:
# service mysqld start # service mysqld stop # service mysqld status
初始随机密码:
# cat /var/log/mysqld.log | more
修改初始密码及授权远程访问:
# mysql -uroot -p mysql> set password='Pwd@123456'; mysql> grant all privileges on *.* to 'root'@'%' identified by 'Pwd@123456';
密码复杂度属性:
mysql> set global validate_password_policy=0;
validate_password_policy有以下取值:(默认是1,即MEDIUM,所以刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符。)
修改数据目录:
新目录需要给mysql用户授权,mysqld_safe日志文件授权,关闭selinux(没找到相关策略设置的方法)
# 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 = 3306 socket = /data/mysql/log/mysql.sock default-character-set=utf8 [mysql] no-auto-rehash socket=/data/mysql/log/mysql.sock default-character-set=utf8 [mysqld] port = 3306 socket = /data/mysql/log/mysql.sock character-set-server=utf8 lower_case_table_names=1 basedir=/usr datadir=/data/mysql/data log-error=/data/mysql/log/error.log pid-file=/data/mysql/log/mysql.pid init_connect='SET NAMES utf8' symbolic-links=0 skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M [mysqld_safe] log-error=/data/mysql/log/mysqld_safe.log */ # getenforce Enforcing # 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=enforcing SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted */ # service mysqld start
其他命令:
# mysqladmin -u root -p password mysql> select version(); # chkconfig --list # chkconfig --level 345 mysqld on # netstat -na | grep 3306
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
饿虎岗资源网 Design By www.oxmxm.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
饿虎岗资源网 Design By www.oxmxm.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 黄乙玲1988-无稳定的爱心肝乱糟糟[日本东芝1M版][WAV+CUE]
- 群星《我们的歌第六季 第3期》[320K/MP3][70.68MB]
- 群星《我们的歌第六季 第3期》[FLAC/分轨][369.48MB]
- 群星《燃!沙排少女 影视原声带》[320K/MP3][175.61MB]
- 乱斗海盗瞎6胜卡组推荐一览 深暗领域乱斗海盗瞎卡组分享
- 炉石传说乱斗6胜卡组分享一览 深暗领域乱斗6胜卡组代码推荐
- 炉石传说乱斗本周卡组合集 乱斗模式卡组最新推荐
- 佟妍.2015-七窍玲珑心【万马旦】【WAV+CUE】
- 叶振棠陈晓慧.1986-龙的心·俘虏你(2006复黑限量版)【永恒】【WAV+CUE】
- 陈慧琳.1998-爱我不爱(国)【福茂】【WAV+CUE】
- 咪咕快游豪礼放送,百元京东卡、海量欢乐豆就在咪咕咪粉节!
- 双11百吋大屏焕新“热”,海信AI画质电视成最大赢家
- 海信电视E8N Ultra:真正的百吋,不止是大!
- 曾庆瑜1990-曾庆瑜历年精选[派森][WAV+CUE]
- 叶玉卿1999-深情之选[飞图][WAV+CUE]