這篇文章給大家分享的是在linux系統(tǒng)中安裝配置MySQL服務(wù)器的詳細(xì)教程,相信大部分人都還不知道怎么安裝,為了讓大家學(xué)會(huì),給大家總結(jié)了以下內(nèi)容,話不多說(shuō),一起往下看吧。
創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、惠水網(wǎng)絡(luò)推廣、微信小程序、惠水網(wǎng)絡(luò)營(yíng)銷(xiāo)、惠水企業(yè)策劃、惠水品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營(yíng)等,從售前售中售后,我們都將竭誠(chéng)為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供惠水建站搭建服務(wù),24小時(shí)服務(wù)熱線:13518219792,官方網(wǎng)址:chinadenli.net
一、在官網(wǎng)下載mysql安裝包
下圖是mysql安裝包的介紹
二、安裝軟件包
1、安裝依賴
# yum -y install perl-Date-Dumper perl-JSON perl-Time-HiRes
2、解壓mysql安裝包
# tar -xvf mysql-5.7.24.tar //解壓mysql包
3、卸載老版本的包
[root@localhost ~]# rm -rf /etc/my.cnf
4、刪除數(shù)據(jù)
[root@localhost ~]# rm -rf /var/lib/mysql/*
5、卸載軟件包(沒(méi)有會(huì)顯示未安裝軟件包)
[root@localhost ~]# rpm -e --nodeps mariadb-server mariadb
警告:/var/log/mariadb/mariadb.log 已另存為/var/log/mariadb/mariadb.log.rpmsave
#yum -y remove mariadb-libs.x86_64 1:5.5.52-1.el7
6、yum源安裝
#yum -y install mysql-community-client mysql-community-common mysql-community-devel mysql-community-embedded mysql-community-embedded-compat mysql-community-embedded-devel mysql-community-libs mysql-community-libs-compat mysql-community-minimal-debuginfo mysql-community-server mysql-community-test
或者
#yum -y install mysql-community-*.rpm
7、查看安裝了的mysql有關(guān)安裝包
# rpm -qa | grep -y mysql
8、啟動(dòng)服務(wù)
# systemctl start mysqld # systemctl enable mysqld //設(shè)置開(kāi)機(jī)自啟 # systemctl status mysqld [root@proxy mysql]# ss -antulp | grep mysqld //查看服務(wù)啟動(dòng)端口 # ps aux | grep mysqld //查進(jìn)程
三、連接數(shù)據(jù)庫(kù)
1、查隨機(jī)生成的root密碼
# grep password /var/log/mysqld.log # grep 'temporary password' /var/log/mysqld.log //隨機(jī)生成的管理密碼
初始密碼登陸mysql:
(?。。∮秒S機(jī)生成密碼登陸必須馬上修改密碼管理,不然會(huì)報(bào)錯(cuò))
2、客戶端命令mysql連接數(shù)據(jù)庫(kù)
# mysql -hlocalhost -uroot -p'pIhMu,i2OS#,' //用初始密碼登錄 mysql> \h //登錄成功后,查可用的快捷鍵
四、修改密碼
1、只能先修密碼
mysql> alter user root@"localhost" identified by "123qqq...A";
2、可以修改密碼限制長(zhǎng)度
mysql> show variables like "%password%"; //查詢密碼有關(guān)的變量 mysql> set global validate_password_policy=0; //只驗(yàn)證長(zhǎng)度 mysql> set global validate_password_length=6; //修改密碼長(zhǎng)度為6位 mysql> alter user root@"localhost" identified by "123456"; //修改root密碼為123456
關(guān)于在linux系統(tǒng)中安裝配置mysql服務(wù)器的教程就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。
分享標(biāo)題:如何在linux系統(tǒng)中安裝配置mysql服務(wù)器
文章鏈接:http://chinadenli.net/article34/gpcese.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站排名、軟件開(kāi)發(fā)、關(guān)鍵詞優(yōu)化、品牌網(wǎng)站制作、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)