Mysql to Doris
mysql to doris is mainly suitable for automating the creation of doris odbc tables, mainly implemented with shell scripts
manual
mysql to doris code here
Directory Structure
1. ├── mysql_to_doris
2. │ ├── conf
3. │ │ ├── doris.conf
4. │ │ ├── mysql.conf
5. │ │ └── tables
6. │ ├── all_tables.sh
7. │ │
8. └── └── user_define_tables.sh
- all_tables.sh
This script mainly reads all the tables under the mysql specified library and automatically creates the Doris odbc external table 2. user_define_tables.sh
This script is mainly used for users to customize certain tables under the specified mysql library to automatically create Doris odbc external tables 3. conf
Configuration file, doris.conf is mainly used to configure doris related, mysql.conf is mainly used to configure mysql related, tables is mainly used to configure user-defined mysql library tables
full
- Download using mysql to doris here
- Configuration related files
``` 1. #doris.conf 2. master_host= 3. master_port= 4. doris_password= 5. doris_odbc_name=''
-
mysql.conf
- mysql_host=
- mysql_password= ```
| Configuration item | illustrate |
|---|---|
| master_host | Doris FE master node IP |
| master_port | Doris FE query_port port |
| doris_password | Doris Password (default root user) |
| doris_odbc_name | The name of mysql odbc in the odbcinst.ini configuration file under be/conf |
| mysql_host | Mysql IP |
| mysql_password | Mysql Password (default root user) |
3. Execute the all_tables.sh script |
1. sh all_tables.sh mysql_db_name doris_db_name
After successful execution, the files directory will be generated, and the directory will contain tables (table name) and tables.sql (doris odbc table creation statement)
custom
- Modify the
conf/tablesfile to add the name of the odbc table that needs to be created - To configure mysql and doris related information, refer to step 2 of full creation
- Execute the
user_define_tables.shscript
1. sh user_define_tables.sh mysql_db_name doris_db_name
After successful execution, the user_files directory will be generated, and the directory will contain tables.sql (doris odbc table creation statement)
