Upload the ESR server seed code.
[aai/esr-server.git] / esr-core / distribution / standalone / src / main / assembly / bin / initDB.bat
1 @REM
2 @REM Copyright 2016 ZTE Corporation.
3 @REM
4 @REM Licensed under the Apache License, Version 2.0 (the "License");
5 @REM you may not use this file except in compliance with the License.
6 @REM You may obtain a copy of the License at
7 @REM
8 @REM     http://www.apache.org/licenses/LICENSE-2.0
9 @REM
10 @REM Unless required by applicable law or agreed to in writing, software
11 @REM distributed under the License is distributed on an "AS IS" BASIS,
12 @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 @REM See the License for the specific language governing permissions and
14 @REM limitations under the License.
15 @REM
16
17 @echo off
18 set HOME=%~dp0
19 set user=%1
20 set password=%2
21 set port=%3
22 set host=%4
23 echo start init extsys db
24 echo HOME=%HOME%
25 set main_path=%HOME%..\
26 cd /d %main_path%
27 mysql -u%user% -p%password% -P%port% -h%host% < dbscripts\mysql\openo-common-extsys-createobj.sql
28 set "err=%errorlevel%"
29 if "%err%"=="0" (
30    echo init extsys db success
31   ) else (
32     echo failed init extsys db
33     pause
34   )