How can I check if the column in MySQL exists using Bash script.
I want to write an if statement and create the column if it does not exist. For example:
col="thecolumn"
if [[ !col ]]; then
db="use myDB; alter table myTable add column name varchar(30) not null;"
mysql -u root -p123456aB "$db"
fi