国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

CentOS 7.2 Yum編譯安裝MySQL 5.6

2024-07-24 12:53:23
字體:
供稿:網(wǎng)友

本文實(shí)例為大家分享CentOS 7.2 Yum安裝mysql5.6的方法,供大家參考,具體內(nèi)容如下

配置CentOS SCLo源

[3] 添加 CentOS SCLo Software collections Repository.[root@linuxprobe~]# yum -y install centos-release-scl-rh centos-release-scl# set [priority=10][root@linuxprobe~]# sed -i -e "s//]$//]/npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo[root@linuxprobe~]# sed -i -e "s//]$//]/npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo# for another way, change to [enabled=0] and use it only when needed[root@linuxprobe~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo[root@dlp ~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

yum安裝MySQL

# 安裝mysql[root@linuxprobe~]# yum --enablerepo=centos-sclo-rh -y install rh-mysql56-mysql-server# 加載環(huán)境變量[root@linuxprobe ~]# scl enable rh-mysql56 bash[root@linuxprobe ~]# mysql -V mysql Ver 14.14 Distrib 5.6.26, for Linux (x86_64) using EditLine wrapper[root@linuxprobe ~]# which mysql /opt/rh/rh-mysql56/root/usr/bin/mysql# 設(shè)置mysql開機(jī)自啟動(dòng)root@linuxprobe ~]# vi /etc/profile.d/rh-mysql56.sh#!/bin/bashsource /opt/rh/rh-mysql56/enableexport X_SCLS="`scl enable rh-mysql56 'echo $X_SCLS'`"

[4] Enable MySQL 5.6 and Configure initial settings.[root@linuxprobe ~]# vi /etc/opt/rh/rh-mysql56/my.cnf.d/mysql-server.cnf# add follows within [mysqld] section[mysqld]character-set-server=utf8[root@linuxprobe ~]# systemctl start rh-mysql56-mysqld[root@linuxprobe ~]# systemctl enable rh-mysql56-mysqld[root@linuxprobe ~]# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MySQL to secure it, we'll need the currentpassword for the root user. If you've just installed MySQL, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none):OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MySQLroot user without the proper authorisation.# set root passwordSet root password? [Y/n] yNew password:Re-enter new password:Password updated successfully!Reloading privilege tables.. ... Success!By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.# remove anonymous usersRemove anonymous users? [Y/n] y ... Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.# disallow root login remotelyDisallow root login remotely? [Y/n] y ... Success!By default, MySQL comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.# remove test databaseRemove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.# reload privilege tablesReload privilege tables now? [Y/n] y ... Success!Cleaning up...All done! If you've completed all of the above steps, your MySQLinstallation should now be secure.Thanks for using MySQL!
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 黎平县| 鄂托克前旗| 宣威市| 永城市| 新晃| 蒙自县| 安阳市| 宝兴县| 甘南县| 信宜市| 肥东县| 霞浦县| 卢龙县| 文昌市| 二连浩特市| 多伦县| 台东县| 洮南市| 南部县| 大庆市| 察雅县| 镇原县| 光泽县| 天峻县| 泗阳县| 东乡县| 新乡市| 塘沽区| 广丰县| 泸水县| 江津市| 会理县| 巩留县| 罗城| 沐川县| 德江县| 抚远县| 库尔勒市| 涞水县| 资阳市| 河东区|