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
├── mysql_to_doris
│ ├── conf
│ │ ├── doris.conf
│ │ ├── mysql.conf
│ │ └── tables
│ ├── all_tables.sh
│ │
└── └── 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
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
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
#doris.conf
master_host=
master_port=
doris_password=
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) Execute the
all_tables.sh
script
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/tables
file 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.sh
script
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)