Custom MySQL Configuration Guide
Software supports custom MySQL. If you need to connect to a custom MySQL database, custom domain, etc., you need to perform the following operations:
- The MySQL database must be version 8.0.30 or later, and standalone/cluster edition is acceptable.
- If it is a version after 8.4, it may not be supported (mysql_native_password is disabled after 8.4)
- MySQL databases started using Docker do not have high availability and are not recommended for use in production environments to store data. The platform recommends connecting to users' own external databases.
- The user configured for Weida to connect to the MySQL database must have table operation permissions (create/drop/alter)
1. MySQL Version Configuration
Take Tencent Cloud CDB as an example. The test version configuration here is as follows, and other MySQL versions can refer to the corresponding references.
The following configuration is for MySQL 8.0 cluster edition +2 CPUs +8gb memory +200GB storage. If you purchase a cloud database, please open access permissions for Weida to the specified port of the cloud database.
Modify the MySQL configuration file (e.g., my.cnf or my.ini) and add the following content:
[client]
default_character_set = utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
sql_mode = ALLOW_INVALID_DATES
explicit_defaults_for_timestamp = OFF
[mysqld]
sql_require_primary_key = OFF
2. Standalone Edition Configuration
2.1. Visual Configuration Deployment
Standalone edition supports external middleware - MySQL visual deployment
Enter in the browser: http://<actual access IP>:38080
to open the installer page. As shown below, you can enable the configuration of external middleware - MySQL.
2.2. Script Configuration Deployment
This step needs to be configured during the deploy weda process after running the installation script ./install.sh
vim config.yaml
i. There is no config.yaml file in the default directory. After creating and opening it with vim, enter the following content:
## config.yaml
customMySQL:
enabled: true
host: 192.168.3.14
port: 3306
username: root
password: xxx
dbName: lowcode
dbRuntimeName: lcruntime
Note: Ensure that the custom mysql you entered is accessible from the current server. Both dbName and dbRuntimeName are databases used during Weida runtime. Please ensure the two databases you entered already exist and cannot share the same database name.
### Corresponding database creation statement for dbName:
CREATE DATABASE `lowcode` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
### Corresponding database creation statement for dbRuntimeName:
CREATE DATABASE `lcruntime` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ii. Save the file and exit.
cat config.yaml
iii. Check that the file content is correct.
2.2. Installation and Deployment
- When using an external MySQL service for the first time, the subsequent installation process is the same as the Deployment Process
- If you have previously installed the MySQL service, run
./upgrade.sh
to complete the upgradeinfoThe MySQL upgrade method does not involve data migration.
2.3. FAQ Troubleshooting
a. After running ./install.sh, it prompts Access denied
Check whether the mysql information entered in the config.yaml
file can be connected from the current machine.
3. Cluster Edition Configuration
3.1. Adding Configuration
This step needs to be configured after downloading the deployment script in the Kubernetes Cluster Edition Deployment Guide.
Edit the cluster installation configuration file config.yaml
middleware:
mysql:
## mysql Database Connection Information
host:
port:
username:
password:
## Database name dbname and dbRuntimeName cannot be identical
dbname:
dbRuntimeName:
3.2. Installation and Deployment
Run the command ./wedaCli up