Get the SQL query result without the table format

Add the -B flag to mysql.

mysql -B -u username -ppassword \
    --disable-column-names \
    --execute "select name from mydb.test"
-B, --batch: Print results in nontabular output format.

--execute: Execute the statement and quit.

Note that -B/--batch also enables the --silent switch.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)