This document shows how you can easily start using Gurux.DLMS.AMI with MySQL database.
In this example, the MySQL docker is used as Gurux.DLMS.AMI database. The MySQL database and Gurux.DLMS.AMI are located on the local PC. The following values are used-
The database super admin password
YOUR_MSSQL_SA_PASSWORD_1
-
Gurux DLMS AMI database name.
YOUR_GURUX_AMI_DB
-
Gurux DLMS AMI database user name.
YOUR_GURUX_AMI_DB_USER_NAME
-
Gurux DLMS AMI database password.
YOUR_GURUX_AMI_DB_USER_PASSWORD_2
-
Your localhost IP address.
YOUR_IP_ADDRESS
Start MySQL docker
You can start MSSQL database docker by running:docker run --name=guruxamidb -e MYSQL_ROOT_PASSWORD=YOUR_MSSQL_SA_PASSWORD_1 -p 3306:3306 -d mysql
Create database user
Open a terminal connection to the docker and start SQL client.mysql -u root -pGive password: YOUR_MSSQL_SA_PASSWORD_1 Create the database:
CREATE DATABASE YOUR_GURUX_AMI_DB;MySQL doesn't allow root remote access as a default. For this reason, the root user can't be connected to the local database from the docker container even if they are on the same computer. You need to create your user for Gurux.DLMS.AMI.
use YOUR_GURUX_AMI_DB; CREATE USER 'YOUR_GURUX_AMI_DB_USER_NAME'@'%' IDENTIFIED BY 'YOUR_GURUX_AMI_DB_USER_PASSWORD_1';Then user permissions to create tables for Gurux.DLMS.AMI.
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, INDEX, REFERENCES, RELOAD on *.* TO 'YOUR_GURUX_AMI_DB_USER_NAME'@'%' WITH GRANT OPTION;
Start GuruxAMI
Before starting the Gurux.DLMS.AMI docker you need your computer IP address. localhost doesn't work. You can get your localhost IP address by running 'ipconfig' in your command line interface. Do not run ipconfig on the docker.ipconfigReplace YOUR_DB_IP_ADDRESS with your IP address. Start Gurux DLMS AMI docker by running:
docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=YOUR_DB_IP_ADDRESS;Database=YOUR_GURUX_AMI_DB;UID=YOUR_GURUX_AMI_DB_USER_NAME;Password=YOUR_GURUX_AMI_DB_USER_PASSWORD_1" -e "IdentityServer:Key:Type=Development" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="YOUR_CREDENTIAL_PASSWORD" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v %USERPROFILE%\.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latestYou can see traces in your command prompt. If you want to run Gurux.DLMS.AMI as a service add -d -argument. Now you can test that Gurux.DLMS.AMI is up and running starting browser:
https://localhost:8001/