get database name in mysql code example Example 1: how to see database in mysql command line SHOW DATABASES; Example 2: mysql get db name SELECT DATABASE();