next up previous contents
Next: 安裝前環境準備 Up: Nova Previous: Nova   Contents

安裝前資料庫準備

  1. Nova 是 Compute 服務,安裝 nova 前必須先產生資料庫,登入 mysql:
    [root@ip112 ~]# mysql -uroot -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 11
    Server version: 10.1.20-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    MariaDB [(none)]>
    
  2. 產生資料庫 nova_api, nova, nova_cell0
    MariaDB [(none)]> CREATE DATABASE nova_api;
    Query OK, 1 row affected (0.00 sec)
    
    MariaDB [(none)]> CREATE DATABASE nova;
    Query OK, 1 row affected (0.00 sec)
    
    MariaDB [(none)]> CREATE DATABASE nova_cell0;
    Query OK, 1 row affected (0.00 sec)
    
  3. 產生用戶 nova 在 localhost,密碼 123qwe,對資料庫 nova_api, nova, nova_cell0 有全部的存取權。
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    
  4. 產生用戶 nova 在 localhost,密碼 123qwe,對資料庫 nova_api, nova, nova_cell0 有全部的存取權。
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
    IDENTIFIED BY '123qwe';
    Query OK, 0 rows affected (0.00 sec)
    
  5. 退出 mysql。
    MariaDB [(none)]> exit
    Bye
    



De-Yu Wang 2018-12-12