User login

See list of MySQL databases via GNU Linux shell command line

Dirty secret is this will work with Windows or anything else that runs MySQL, as well as the recommended Debian, Ubuntu, Red Hat / RHEL (which is what CentOS really is) etc.

mysql -u root -p

(The long form, which is quite unnecessary, is " mysql --user=user-name --password=your-password")

Once in the MySQL command line utility:

SHOW DATABASES;

Then to see what's in a particular database:

USE agaric_example
SHOW TABLES;

(None of this has to be capital letters; I'm just used to that from MySQL convention.)

Resolution

Searched words: 
mysql list databases command line check if database exists

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.