Login as root, then
show databases; # lists all databasesuse information_schema; # connect to the mysql schemashow tables; select * from tables;
Everything you need is in the information_schema schema. If all you want to do is backup the db, use the builtin dump/restore capabilities.