时间:2021-05-24
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 -pmysql> 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 = 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其他命令:
# mysqladmin -u root -p passwordmysql> select version();# chkconfig --list# chkconfig --level 345 mysqld on# netstat -na | grep 3306以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
安装MySQL5.7.17的方法如下所示:1.下载http:///linux/149-150-153.html2.上传解压tar-xvfmysql-5.7.17
mysql5.7.17安装配置方法整理第一步到MySQL官网下载mysql-5.7.17-winx64.zip第二步解压缩mysql-5.7.17-winx64
win7下安装MySQL5.7.17图文教程,分享给大家。1.下载安装包请在以下https://dev.mysql.com/downloads/mysql/有Z
在此文中,我将详细讲解如何在Windows10平台中安装MySQL数据库的最新版本,即MySQL5.7.17压缩版数据库。关于MySQL5.7.17数据库压缩版
本文为大家分享了mysql5.7.17安装配置方法,供大家参考,具体内容如下1、下载MySQL数据库的安装包:mysql-5.7.17.msi.下载完成之后,双