Show databases

To see all of the databases, we are going to use the command show databases. Create the script to see all of the databases:

mysql -u root -pTraining2@^ <<MY_QUERY 
show databases; 

Save the script and run it as follows:

          $ chmod +x
          $ ./

The output will be:

    Database information_schema mysql performance_schema sys testdb

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.