openEuler安裝Mysql5.7

打開終端,并使用以下命令添加 MySQL 5.7 的軟件源
sudo dnf install https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
下載 MySQL 公鑰文件
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql
確認(rèn)公鑰已正確導(dǎo)入
sudo rpm -qa gpg-pubkey*
安裝 MySQL 5.7
sudo dnf install mysql-community-server -y
如果您仍然遇到 GPG 檢查失敗的錯誤至非,在運(yùn)行安裝命令時(shí)篷朵,可以使用 --nogpgcheck 選項(xiàng)禁用 GPG 檢查勾怒。例如:
sudo dnf install mysql-community-server --nogpgcheck -y
完成安裝后婆排,啟動 MySQL 服務(wù)
sudo  systemctl enable mysqld
sudo systemctl start mysqld
使用以下命令查看 MySQL 服務(wù)狀態(tài),確保它正在運(yùn)行
sudo systemctl status mysqld
查看root密碼
sudo grep 'temporary password' /var/log/mysqld.log
運(yùn)行以下命令來保護(hù)您的 MySQL 安裝 sudo mysql_secure_installation
[root@localhost ~]# sudo mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:   //輸入root密碼
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration of the plugin.
Using existing password for root.
Estimated strength of the password: 25
Change the password for root ? ((Press y|Y for Yes, any other key for No) : No  //是否更改root密碼笔链,如果輸入y會要求設(shè)置新的密碼
 ... skipping.
By default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y  //是否刪除匿名用戶段只,建議y刪除
Success.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y  //是否禁止root遠(yuǎn)程登錄,建議y禁止
Success.
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y  //是否刪除test數(shù)據(jù)庫卡乾,y刪除
 - Dropping test database...
Success.
 - Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y  //是否重新加載權(quán)限表翼悴,y重新加載
Success.
All done!
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末鹦赎,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子误堡,更是在濱河造成了極大的恐慌古话,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,277評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件锁施,死亡現(xiàn)場離奇詭異陪踩,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)悉抵,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,689評論 3 393
  • 文/潘曉璐 我一進(jìn)店門肩狂,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人姥饰,你說我怎么就攤上這事傻谁。” “怎么了列粪?”我有些...
    開封第一講書人閱讀 163,624評論 0 353
  • 文/不壞的土叔 我叫張陵审磁,是天一觀的道長。 經(jīng)常有香客問我岂座,道長态蒂,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,356評論 1 293
  • 正文 為了忘掉前任费什,我火速辦了婚禮钾恢,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘鸳址。我一直安慰自己赘那,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,402評論 6 392
  • 文/花漫 我一把揭開白布氯质。 她就那樣靜靜地躺著募舟,像睡著了一般。 火紅的嫁衣襯著肌膚如雪闻察。 梳的紋絲不亂的頭發(fā)上拱礁,一...
    開封第一講書人閱讀 51,292評論 1 301
  • 那天琢锋,我揣著相機(jī)與錄音,去河邊找鬼呢灶。 笑死吴超,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的鸯乃。 我是一名探鬼主播鲸阻,決...
    沈念sama閱讀 40,135評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼缨睡!你這毒婦竟也來了鸟悴?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,992評論 0 275
  • 序言:老撾萬榮一對情侶失蹤奖年,失蹤者是張志新(化名)和其女友劉穎细诸,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體陋守,經(jīng)...
    沈念sama閱讀 45,429評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡震贵,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,636評論 3 334
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了水评。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片猩系。...
    茶點(diǎn)故事閱讀 39,785評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖中燥,靈堂內(nèi)的尸體忽然破棺而出寇甸,到底是詐尸還是另有隱情,我是刑警寧澤褪那,帶...
    沈念sama閱讀 35,492評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站式塌,受9級特大地震影響博敬,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜峰尝,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,092評論 3 328
  • 文/蒙蒙 一偏窝、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧武学,春花似錦祭往、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,723評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至熏矿,卻和暖如春已骇,著一層夾襖步出監(jiān)牢的瞬間离钝,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,858評論 1 269
  • 我被黑心中介騙來泰國打工褪储, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留卵渴,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,891評論 2 370
  • 正文 我出身青樓鲤竹,卻偏偏與公主長得像浪读,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子辛藻,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,713評論 2 354

推薦閱讀更多精彩內(nèi)容