Hi, We have a flink sql job that connect to mysql....
# troubleshooting
r
Hi, We have a flink sql job that connect to mysql. But flink sql needs to hardcode password in the code instead of reading env variables. Code sample like:
Copy code
CREATE TABLE orders (
     order_id INT,
     order_date TIMESTAMP(0),
     customer_name STRING,
     price DECIMAL(10, 5),
     product_id INT,
     order_status BOOLEAN,
     PRIMARY KEY(order_id) NOT ENFORCED
     ) WITH (
     'connector' = 'mysql-cdc',
     'hostname' = 'localhost',
     'port' = '3306',
     'username' = 'root',
     'password' = '123456',
     'database-name' = 'mydb',
     'table-name' = 'orders');
May I know is there a solution can avoid to hardcode password in the code? Truly appreciate!
πŸ™ 1
r
I've not yet seen such a feature in Flink. There's a small chance it exists but it is more likely that this is not supported. I suspect many environments use AWS IAM auth or something, where no password at all is needed
k
@Roger Wang May be you can build the SQL using your code and setting up environment param in cluster deployment.