五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

阿里云 Centos7.3安裝mysql5.7.18 rpm安裝教程

發(fā)布日期:2022-04-12 16:34 | 文章來源:源碼之家

卸載MariaDB

CentOS7默認(rèn)安裝MariaDB而不是MySQL,而且yum服務(wù)器上也移除了MySQL相關(guān)的軟件包。因為MariaDB和MySQL可能會沖突,故先卸載MariaDB。

1、安裝新版mysql之前,我們需要將系統(tǒng)自帶的mariadb-lib卸載

[root@iZwz94qazh62gk5ewl4ei2Z home]# rpm -qa | grep -i mariadb
mariadb-libs-5.5.52-1.el7.x86_64
[root@iZwz94qazh62gk5ewl4ei2Z home]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

2、到mysql的官網(wǎng)下載最新版mysql的rpm集合包:mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar

3、上傳mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar到linux服務(wù)器,并解壓tar包

[root@iZwz94qazh62gk5ewl4ei2Z home]# mkdir mysql
[root@iZwz94qazh62gk5ewl4ei2Z home]# tar -xf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar -C mysql
[root@iZwz94qazh62gk5ewl4ei2Z home]# cd mysql
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# ll
total 459492
-rw-r--r-- 1 7155 31415 23618836 Mar 20 17:40 mysql-community-client-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415  335496 Mar 20 17:40 mysql-community-common-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415  3747352 Mar 20 17:40 mysql-community-devel-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 39086508 Mar 20 17:40 mysql-community-embedded-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 135869292 Mar 20 17:40 mysql-community-embedded-devel-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415  2177064 Mar 20 17:40 mysql-community-libs-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415  1723180 Mar 20 17:40 mysql-community-libs-compat-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 159060212 Mar 20 17:41 mysql-community-server-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 104881084 Mar 20 17:41 mysql-community-test-5.7.18-1.el6.x86_64.rpm

4、使用rpm -ivh命令進(jìn)行安裝

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# rpm -ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...             ################################# [100%]
Updating / installing...
  1:mysql-community-common-5.7.18-1.e################################# [100%]
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-libs-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...             ################################# [100%]
Updating / installing...
  1:mysql-community-libs-5.7.18-1.el6################################# [100%]
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...             ################################# [100%]
Updating / installing...
  1:mysql-community-client-5.7.18-1.e################################# [100%]
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# rpm -ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...             ################################# [100%]
Updating / installing...
  1:mysql-community-server-5.7.18-1.e################################# [100%]
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# 

上面幾個包有依賴關(guān)系,執(zhí)行有先后。

使用rpm安裝方式安裝mysql,安裝的路徑如下:

a 數(shù)據(jù)庫目錄
/var/lib/mysql/
b 配置文件
/usr/share/mysql(mysql.server命令及配置文件)
c 相關(guān)命令
/usr/bin(mysqladmin mysqldump等命令)
d 啟動腳本
/etc/rc.d/init.d/(啟動腳本文件mysql的目錄)
e /etc/my.conf

5、 數(shù)據(jù)庫初始化

為了保證數(shù)據(jù)庫目錄為與文件的所有者為 mysql 登陸用戶,如果你的linux系統(tǒng)是以 root 身份運(yùn)行 mysql 服務(wù),需要執(zhí)行下面的命令初始化

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# mysqld --initialize --user=mysql

如果是以 mysql 身份登錄運(yùn)行,則可以去掉 --user 選項。

另外 --initialize 選項默認(rèn)以“安全”模式來初始化,則會為 root 用戶生成一個密碼并將該密碼標(biāo)記為過期,登陸后你需要設(shè)置一個新的密碼,

而使用 --initialize-insecure 命令則不使用安全模式,則不會為 root 用戶生成一個密碼。

這里演示使用的 --initialize 初始化的,會生成一個 root 賬戶密碼,密碼在log文件里,紅色區(qū)域的就是自動生成的密碼

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# cat /var/log/mysqld.log
2017-06-05T14:30:52.709474Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-05T14:30:55.590590Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-06-05T14:30:56.000269Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-06-05T14:30:56.109868Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 960c533e-49fb-11e7-91f2-00163e089fd2.
2017-06-05T14:30:56.116186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-06-05T14:30:56.116777Z 1 [Note] A temporary password is generated for root@localhost: :Wu?2QQutQwj

現(xiàn)在啟動mysql數(shù)據(jù)庫systemctl start mysqld.service(Centos7特有的啟動方式)

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# systemctl start mysqld.service

可以使用下面兩個命令對mysql進(jìn)行停止,啟動和重啟:

啟動:

使用 service 啟動:service mysqld start
使用 mysqld 腳本啟動:/etc/inint.d/mysqld start
使用 safe_mysqld 啟動:safe_mysqld&

停止:

使用 service 啟動:service mysqld stop
使用 mysqld 腳本啟動:/etc/inint.d/mysqld stop
mysqladmin shutdown

重啟:

使用 service 啟動:service mysqld restart
使用 mysqld 腳本啟動:/etc/inint.d/mysqld restart

連接數(shù)據(jù)庫

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# mysql -u root -p
Enter password:

密碼輸入: :Wu?2QQutQwj

修改密碼:

set password = password('你的密碼');
設(shè)置遠(yuǎn)程訪問

grant all privileges on *.* to 'root' @'%' identified by '123456'; 
flush privileges;

設(shè)置mysql開機(jī)啟動

加入到系統(tǒng)服務(wù):

chkconfig --add mysql

自動啟動:

chkconfig mysql on

查詢列表:

chkconfig

說明:都沒關(guān)閉(off)時是沒有自動啟動。

以上所述是小編給大家介紹的阿里云 Centos7.3安裝mysql5.7.18 rpm安裝教程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對本站網(wǎng)站的支持!

國外穩(wěn)定服務(wù)器

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部