CentOS7安裝MySQL

1.安裝依賴

yum search libaio           #檢索是否有對應庫
yum install -y libaio        #安裝依賴包

2.檢查MySQL是否已經安裝

yum installed | grep mysql
No such command: installed. Please use /bin/yum --help

 

3.下載MySQL Yum Repository(yum倉庫)

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

 

 

4.若是沒有wget命令,則下載對應安裝包

yum –y install wget

 

5.添加MySQL Yum Repository到系統repository列表中

yum localinstall mysql57-community-release-el7-10.noarch.rpm

 

 

6.驗證是否添加成功 

yum repolist enabled | grep "mysql.*-community.*"

 

7.安裝MySQL 

yum -y install mysql-community-server

 

 

8.啓動MySQL

systemctl start mysqld
systemctl status mysqld        #查看狀態

 

 

 

9.驗證MySQL

登錄:mysql -uroot –p

輸入密碼登錄。

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.7.26



Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.



Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.



Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.00 sec)

 

10.建立Hive須要的數據庫

mysql> create database if not exists hive_metadata;

Query OK, 1 row affected (0.01 sec)



mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| hive_metadata      |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

5 rows in set (0.00 sec)

 

爲hive_metadata設置權限mysql

grant all privileges on hive_metadata.* to 'hive'@'%' identified by 'hive';

grant all privileges on hive_metadata.* to 'hive'@'locaclhost' identified by 'hive';

grant all privileges on hive_metadata.* to 'hive'@'centos-master' identified by 'hive';

flush privileges;

 

(Navicat)鏈接測試sql


以上就是博主爲你們介紹的這一板塊的主要內容,這都是博主本身的學習過程,但願能給你們帶來必定的指導做用,有用的還望你們點個支持,若是對你沒用也望包涵,有錯誤煩請指出。若有期待可關注博主以第一時間獲取更新哦,謝謝!同時也歡迎轉載,但必須在博文明顯位置標註原文地址,解釋權歸博主全部!數據庫

相關文章
相關標籤/搜索