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. └── └── user_define_tables.sh
  1. 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

  1. Download using mysql to doris here

  2. Configuration related files

    1. #doris.conf
    2. master_host=
    3. master_port=
    4. doris_password=
    5. doris_odbc_name=''
    6. #mysql.conf
    7. mysql_host=
    8. mysql_password=
    Configuration itemillustrate
    master_hostDoris FE master node IP
    master_portDoris FE query_port port
    doris_passwordDoris Password (default root user)
    doris_odbc_nameThe name of mysql odbc in the odbcinst.ini configuration file under be/conf
    mysql_hostMysql IP
    mysql_passwordMysql 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

  1. Modify the conf/tables file to add the name of the odbc table that needs to be created
  2. To configure mysql and doris related information, refer to step 2 of full creation
  3. Execute the user_define_tables.sh script
  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)