HINT statement, you need to add the -c option in the command; otherwise, the hint will be filtered by the tool.mysql -h hostname -u username -p -c for connection through the private network.PREPARE statement when the hint syntax is used through the database proxy.-- Hint statement/* to master */or/*FORCE_MASTER*/
-- Example-- Specify the primary instance to perform the query operationSELECT /* to master */ * FROM users WHERE user_id = 1;-- Specify the primary instance to perform the update operationUPDATE /* FORCE_MASTER */ orders SET status = 'shipped' WHERE order_id = 1001;
-- Hint statement/* to slave */or/*FORCE_SLAVE*/
-- Example-- Specify a read-only instance to perform the query operationSELECT /* to slave */ * FROM products WHERE category = 'electronics';-- Specify a read-only instance to perform the count operationSELECT /* FORCE_SLAVE */ COUNT(*) FROM transactions WHERE status = 'completed';
-- Specify the read-only analysis engine to perform the query operationSELECT /* to ap */ * FROM products WHERE category = 'electronics';
-- Hint statement/* to server server_name */
-- Example-- Specify the instance test_ro_1 to perform the query operationSELECT /* to server test_ro_1 */ * FROM inventory WHERE product_id = 2002;

Feedback