diff options
Diffstat (limited to 'resources')
-rw-r--r-- | resources/bin/initDB.sh | 6 | ||||
-rw-r--r-- | resources/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/resources/bin/initDB.sh b/resources/bin/initDB.sh index 3b277935..9d157283 100644 --- a/resources/bin/initDB.sh +++ b/resources/bin/initDB.sh @@ -25,10 +25,10 @@ sql_path=$HOME/../ mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -P$MYSQL_PORT -h$MYSQL_IP <$sql_path/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql sql_result=$? if [ $sql_result -ne 0 ] ; then - echo "failed to create nfvocatalog database" + echo "Failed to create nfvocatalog database" exit 1 -elif [ $sql_result -eq 0 ]; then - echo "create nfvocatalog database successfully" +else + echo "Create nfvocatalog database successfully" exit 0 fi diff --git a/resources/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql b/resources/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql index a1fd3e2c..791bd7f5 100644 --- a/resources/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql +++ b/resources/dbscripts/mysql/vfc-nfvo-catalog-createdb.sql @@ -14,14 +14,11 @@ -- limitations under the License. -- -/******************drop old database and user***************************/ +/******************create database and user***************************/ use mysql; -drop database IF EXISTS nfvocatalog; -delete from user where User='nfvocatalog'; -FLUSH PRIVILEGES; -/******************create new database and user***************************/ -create database nfvocatalog CHARACTER SET utf8; +create database if not exists nfvocatalog CHARACTER SET utf8; + GRANT ALL PRIVILEGES ON nfvocatalog.* TO 'nfvocatalog'@'%' IDENTIFIED BY 'nfvocatalog' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON mysql.* TO 'nfvocatalog'@'%' IDENTIFIED BY 'nfvocatalog' WITH GRANT OPTION; |