一、mysqlyum源
1. 配置yum源
curl -o
安裝mysql源:
yum localinstall mysql57-community-release-el7-11.noarch.rpm
檢查mysql源是否安裝成功:
yum repolist enabled | grep "mysql.*-community.*"
顯示如下就表示安裝成功:
mysql-connectors-community/x86_64 mysql connectors community 51mysql-tools-community/x86_64 mysql tools community 63mysql57-community/x86_64 mysql 5.7 community server 267
2. 安裝mysql
yum install mysql-community-server
3. 啟動mysql服務
systemctl start mysqld
4. 檢視mysql狀態
systemctl status mysqld
5. 設定mysql開機啟動
systemctl enable mysqld# 對於新建立的unit檔案或修改了的unit檔案,要通知systemd過載此配置檔案systemctl daemon-reload
6. 修改root本地登入密碼
查詢root預設密碼:
grep
'temporary password' /var/log/mysqld.log
顯示:
2018-07-05t12:25:29.669624z 1 [note] a temporary password is generated for
root@localhost: eeve.mb=/2lw
修改root本地登入密碼:
mysql -u root -p
enter password:
mysql> alter user 'root'@'localhost' identified by 'mypass68@';
query ok, 0 rows affected (0.00 sec)
給root帳號開啟遠端訪問許可權:
# 這裡主要為集群節點開發遠端訪問許可權mysql> grant all privileges on *.* to 'root'@'10.10.26.%' identified by 'mypasmysql> update mysql.user set grant_priv='y', super_priv='y' where user='root';mysql> flush privileges;
二、建立資料庫與帳號
1. 為hive建立帳號與資料庫(metastore)
mysql> create database metastore default character set utf8 default collate utf8_general_ci;query ok, 1 row affected (0.00 sec)
mysql> grant all on metastore.* to 'hive'@'%' identified by 'mypass99@';query ok, 0 rows affected (0.00 sec)
2. 為druid建立帳號與資料庫(druid)
mysql> create database druid default character set utf8 default collate utf8_general_ci;query ok, 1 row affected (0.00 sec)
mysql> grant all on druid.* to 'druid'@'%' identified by 'mypass99@';query ok, 0 rows affected (0.00 sec)
3. 為oozie建立帳號與資料庫(oozie)
mysql> create database oozie default character set utf8 default collate utf8_general_ci;query ok, 1 row affected (0.00 sec)
mysql> grant all on oozie.* to 'oozie'@'%' identified by 'mypass99@';query ok, 0 rows affected (0.00 sec)
4. 確認建立的所有資料庫
mysql> show databases;
5. 確認授予使用者的許可權
mysql> show grants for 'hive'@'%';mysql> show grants for 'druid'@'%';mysql> show grants for 'oozie'@'%';
使用MySQL的yum源安裝MySQL5 7
一 安裝配置mysql的yum源1 安裝yum config manager yuminstallyum utils y 禁用mysql5.6的源 yum config manager disable mysql56 community 啟用mysql5.7的源 yum config manager...
CenOS基於yum源安裝MySQL
1.查詢是否已經安裝 rpm qa grep mysql 2.解除安裝 yum y remove mysql libs mysql devel mysql mysql server 3 查詢殘留檔案 find iname mysql 4 刪除查詢得到的資料1.安裝 yum y install mys...
Ubuntu 安裝MySQL 國內映象源
通過lsb release a命令檢視ubuntu 版本。選擇你的ubuntu 版本,將以下對應版本的內容寫進 etc apt sources.list.d mysql community.list ubuntu 18.04 lts deb bionic mysql 5.7 mysql 8.0 my...