To create the database tables, connect to the database that you created earlier and run the relevant scripts.
Alternatively, you can create database tables automatically when starting the product for the first time by using the
-Dsetup parameter as follows:
To create tables in the registry and user manager database (
WSO2CARBON_DB), execute the relevant script as shown below.
Code Block language powershell
mysql -u regadmin -p -Dregdb < '<PRODUCT_HOME>/dbscripts/mysql.sql';
Note title For MySQL 5.7: Anchor mysqlnote mysqlnote
From Carbon kernel 4.4.6 onwards your product will be shipped with two scripts for MySQL as follows (click here to see if your product is based on this kernel version or newer):
mysql.sql: Use this script for MySQL versions prior to version 5.7.
mysql5.7.sql: Use this script for MySQL 5.7 and later versions.
Note that if you are automatically creating databases during server startup using the
mysql.sqlscript will be used by default to set up the database. Therefore, if you have MySQL version 5.7 set up for your server, be sure to do the following before starting the server:
First, change the existing
mysql.sqlfile to a different filename.
- Change the
- Change the
MySQL 5.7 is only recommended for products that are based on Carbon 4.4.6 or a later version.
Restart the server.
Note to writers: Add this content at the end of the page if any of the additional databases is relevant to your product.
Changing the identity/storage/product-specific databases
>The topics above show how to change the
WSO2_CARBON_DB, which is used to store registry and user manager information. If you changed the product-specific database that comes by default or set up a separate database for identity or storage related data, the instructions are the same. In summary:
Create the database tables using the following scripts:
Update the following configurations, with the defined datasource name of the corresponding database configuration you added to the
If you are setting up a separate database to store identity-related data, update the following configurations in the <
<JDBCPersistenceManager> <DataSource> <!-- Include a data source name (jndiConfigName) from the set of datasources defined in master-datasources.xml --> <Name>jdbc/WSO2CarbonDB</Name> </DataSource> </JDBCPersistenceManager>