最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
當前位置: 首頁 - 科技 - 知識百科 - 正文

linux下使用RPM安裝mysql5.7.17

來源:懂視網(wǎng) 責編:小采 時間:2020-11-09 20:37:44
文檔

linux下使用RPM安裝mysql5.7.17

linux下使用RPM安裝mysql5.7.17: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.x8
推薦度:
導讀linux下使用RPM安裝mysql5.7.17: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.x8

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,所以剛開始設置的密碼必須符合長度,且必須含有數(shù)字,小寫或大寫字母,特殊字符。)

修改數(shù)據(jù)目錄:

 新目錄需要給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

聲明:本網(wǎng)頁內容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

linux下使用RPM安裝mysql5.7.17

linux下使用RPM安裝mysql5.7.17: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.x8
推薦度:
標簽: linux linu rpm
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top