-
到官網(wǎng)下載最新的的安裝包:
[root@study data]# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
-
卸載CentOS7自帶的MariaDB依賴:
[root@study selinux]# rpm -qa|grep mariadb mariadb-libs-5.5.60-1.el7_5.x86_64 [root@study selinux]# rpm -e --nodeps mariadb-libs [root@study selinux]# rpm -qa|grep mariadb
-
解壓下載的安裝包
[root@study data]# tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
-
安裝net-tools
[root@study data]# yum -y install net-tools
-
依次安裝mysql包
[root@study data]# rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm [root@study data]# rpm -ivh mysql-community-libs* [root@study data]# rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm [root@study data]# rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm warning: mysql-community-server-8.0.13-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: /usr/bin/perl is needed by mysql-community-server-8.0.13-1.el7.x86_64 perl(Getopt::Long) is needed by mysql-community-server-8.0.13-1.el7.x86_64 perl(strict) is needed by mysql-community-server-8.0.13-1.el7.x86_64 ### 安裝缺失的perl依賴包 [root@study data]# yum install perl [root@study data]# rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
-
啟動(dòng)mysql立帖,獲取默認(rèn)root密碼,登錄mysql數(shù)據(jù)庫
[root@study data]# systemctl start mysqld.service [root@study data]# grep 'temporary password' /var/log/mysqld.log 2018-11-16T15:15:20.149816Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: J/V3,F-pa;>X [root@study data]# mysql -uroot -p
-
初始化mysql
[root@study data]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: $RFV5tgb Re-enter new password: $RFV5tgb Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y 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 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 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 - 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 Success. All done!
-
修改root密碼棘利,新建study用戶
### 初始化時(shí)已更改root密碼傍妒,這里可以省略 # mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '$RFV5tgb'; ### 這里是避免SQLyog連接8.0報(bào):Error No.2058 Plugin caching_sha2_password could not be loaded向胡,后續(xù)工具更新后,再使用8.0新的加密方式 mysql> CREATE USER 'study'@'localhost' IDENTIFIED WITH mysql_native_password BY '^YHN7ujm'; ### 授予study所有權(quán)限 mysql> GRANT ALL PRIVILEGES ON *.* TO 'study'@'localhost' WITH GRANT OPTION;
-
用SQLyog進(jìn)行連接
ps: 由于mysql沒有開啟遠(yuǎn)程連接千所,通過ssh連接跳轉(zhuǎn)
- 配置SSH Tunneling
配置ssh- 填寫mysql連接信息枷邪,注意host填:127.0.0.1
配置mysql連接
CentOS7使用rpm安裝MySQL8
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門澎灸,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人蛔垢,你說我怎么就攤上這事击孩。” “怎么了鹏漆?”我有些...
- 文/不壞的土叔 我叫張陵巩梢,是天一觀的道長(zhǎng)创泄。 經(jīng)常有香客問我,道長(zhǎng)括蝠,這世上最難降的妖魔是什么鞠抑? 我笑而不...
- 正文 為了忘掉前任场斑,我火速辦了婚禮始苇,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘辫诅。我一直安慰自己法绵,他們只是感情好箕速,可當(dāng)我...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著朋譬,像睡著了一般盐茎。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上徙赢,一...
- 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼搀庶!你這毒婦竟也來了拐纱?” 一聲冷哼從身側(cè)響起,我...
- 序言:老撾萬榮一對(duì)情侶失蹤哥倔,失蹤者是張志新(化名)和其女友劉穎秸架,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體咆蒿,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡东抹,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了沃测。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片缭黔。...
- 正文 年R本政府宣布惧互,位于F島的核電站哎媚,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏喊儡。R本人自食惡果不足惜拨与,卻給世界環(huán)境...
- 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望艾猜。 院中可真熱鬧买喧,春花似錦、人聲如沸匆赃。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽炸庞。三九已至钱床,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間埠居,已是汗流浹背。 一陣腳步聲響...
- 正文 我出身青樓兽泣,卻偏偏與公主長(zhǎng)得像绎橘,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子唠倦,可洞房花燭夜當(dāng)晚...