MySQL is a relational database management system. It has become one of the most popular relational database management systems due to its simple installation, multi-threading, cross-platform, high-performance, portability and open source characteristics. iPortal supports the use of MySQL database to store portal data, security information and monitoring information.
Install and configure the MySQL database
If you've already installed the MySQL database, you can directly configure the portal data storage, security information storage, and monitoring information storage after creating the database. If you didn't install MySQL yet, please refer to: MySQL installation and configuration.
Note: In iPortal, portal data, security information, and monitoring information can't be stored in the same MySQL database. You need to create different databases to store them.
Portal data storage configuration
It's recommended to configure the portal data storage before iPortal is started (before creating the initial administrator account). The configuration information is in the iportal.xml configuration file in the installation directory (%SuperMap iPortal_HOME%\webapps\iportal\WEB-INF). For details, see the iPortal configuration file description. As shown below, you only need to remove or delete the SQLite database connection pool configuration information, and remove the comment of the MySQL database connection pool configuration information.
<dbType>MYSQL</dbType>
<driverClass>org.mariadb.jdbc.Driver</driverClass>
<jdbcUrl>jdbc:mysql://localhost:3306/iportal?useUnicode=true&characterEncoding=UTF-8</jdbcUrl>
<maxPoolSize>30</maxPoolSize>
<initialPoolSize>5</initialPoolSize>
<minPoolSize>5</minPoolSize>
<maxIdleTime>3000</maxIdleTime>
<maxWait>300000</maxWait>
<username>root</username>
<password></password>
- <dbType>: Database type, characters need to be uppercase.
- <driverClass>: The full name of the database driver class.
- <jdbcUrl>: If SuperMap iPortal and MySQL are on the same machine, the IP is localhost. If they are not on the same machine, the IP here should be the IP of the machine where MySQL is located. The default port for MySQL is: 3306, which you can configure based on the actual situation of the MySQL you installed. Database is the database name and the default is iportal. Ensure the name of existing database and the database you created should be matched.
- <maxPoolSize>: The maximum number of active connections the connection pool provides at the same time.
- <initialPoolSize>: The initial size of the connection pool.
- <minPoolSize>: The minimum number of active connections the connection pool provides at the same time.
- <maxIdleTime>: Maximum idle time, the connection is discarded if not used within maxIdleTime. The default value is 0 and if maxIdleTime is 0, it will never be discarded.
- <maxWait>: The maximum number of milliseconds the database waits for, when an exception occurs (when no connection is available).
- <username>: Username of the initial administrator account for the MySQL database, which you can configure based on the MySQL you actually installed.
- <password>: MySQL database does not have an initial password, so you can configure it according to the MySQL you installed.
If MySQL database has already installed on your system, you can configure information of MySQL in the iportal.xml configuration file and need to configure it according to the MySQL you installed, such as MySQL IP, port, database name, username and password.
Note:
- The initial admin account for MySQL is root with no password.
- MySQL disables non-native access by default. However, for the case when iPortal and MySQL are not on the same machine, iPortal needs to connect to MySQL remotely. At this point, find the "user" table in "mysql" database after logging in to MySQL from the local machine, change the "host" item of the first record from "localhost" to '%', then restart MySQL. In addition, the "localhost" in the <jdbc> node in the iportal.xml configuration file also needs to be changed to the IP address of the machine, where MySQL is located.
- The above mentioned procedures and procedures to switch to the MySQL database should be performed before the iPortal initialization service is started (before the administrator account is created). If you switch the database during the use of iPortal, you need to handle the synchronization of the database information.
Security information storage configuration
You can configure the iPortal security information storage after the iPortal is started. Log in to iPortal as the administrator, enter Management > Security, you can perform the security information configuration operations on the "Security Config" page. For details, see: Security information storage.
Monitoring information storage configuration
Once the server monitoring function of SuperMap iPortal is used, the monitoring information storage configuration needs to be performed before monitoring is enabled. The configuration information is in the iportal-monitor.xml configuration file in the installation directory (%SuperMap iPortal_HOME%\webapps\iportal\WEB-INF). The configuration information of the MySQL database has been written directly and you just need to open the comment. As shown below, you only need to comment out or delete the SQLite database connection pool configuration and remove the comment of the MySQL database connection pool configuration.
<dbType>MYSQL</dbType>
<driverClass>org.mariadb.jdbc.Driver</driverClass>
<jdbcUrl>jdbc:mysql://localhost:3306/monitor?useUnicode=true&characterEncoding=UTF-8</jdbcUrl>
<maxPoolSize>30</maxPoolSize>
<initialPoolSize>5</initialPoolSize>
<minPoolSize>5</minPoolSize>
<maxIdleTime>3000</maxIdleTime>
<maxWait>30000</maxWait>
<username>root</username>
<password></password>
- <dbType>: Database type, characters need to be uppercase.
- <driverClass>: The full name of the database driver class.
- <jdbcUrl>: If SuperMap iPortal and MySQL are on the same machine, the IP is localhost. If they are not on the same machine, the IP here should be the IP of the machine where MySQL is located. The default port for MySQL is: 3306, which you can configure based on the actual situation of the MySQL you installed. Database is the database name and the default is iportal. Ensure the name of existing database and the database you created should be matched.
- <maxPoolSize>: The maximum number of active connections the connection pool provides at the same time.
- <initialPoolSize>: The initial size of the connection pool.
- <minPoolSize>: The minimum number of active connections the connection pool provides at the same time.
- <maxIdleTime>: Maximum idle time, the connection is discarded if not used within maxIdleTime. The default value is 0 and if maxIdleTime is 0, it will never be discarded.
- <maxWait>: The maximum number of milliseconds the database waits for, when an exception occurs (when no connection is available).
- <username>: Username of the initial administrator account for the MySQL database, which you can configure based on the MySQL you actually installed.
- <password>: MySQL database does not have an initial password, so you can configure it according to the MySQL you installed.
If MySQL database has already installed on your system, you can configure information of MySQL in the iportal-monitor.xml configuration file and need to configure it according to the MySQL you installed, such as MySQL IP, port, database name, username and password.
Note:
- The initial admin account for MySQL is root with no password.
- MySQL disables non-native access by default. However, for the case when iPortal and MySQL are not on the same machine, iPortal needs to connect to MySQL remotely. At this point, find the "user" table in "mysql" database after logging in to MySQL from the local machine, change the "host" item of the first record from "localhost" to '%', then restart MySQL. In addition, the "localhost" in the <jdbc> node in the iportal-monitor.xml configuration file also needs to be changed to the IP address of the machine, where MySQL is located.