1. SELECT CONCAT(
    2. "*3\r\n",
    3. '$',LENGTH(redis_cmd),'\r\n',redis_cmd,'\r\n',
    4. '$',LENGTH(redis_key),'\r\n',redis_key,'\r\n',
    5. '$',LENGTH(redis_val),'\r\n',redis_val,'\r'
    6. ) FROM (
    7. SELECT 'SET' as redis_cmd,
    8. id as redis_key,
    9. name as redis_val
    10. FROM table_example
    11. ) AS table
    12. $ mysql -hlocalhost -uusername -ppassword dbname \
    13. --skip-column-names --raw < data.sql | redis-cli --pipe