Posts Tagged 'MySQL'

How To Back Up A MySQL Database From a Command Prompt

I just upgraded my WordPress installation to 2.6.3 and have some tips for you future Googlers.

To back up your database from the command prompt, type:

mysqldump –user=username –password=password databasename > filename

Example:

mysqldump –user=foo –password=123456 foodb > foodb.bak

Advertisements

How To Get The Current User in MySQL

To determine who you are currently logged in as in a MySQL command prompt, type the following:

mysql> select user()

or

mysql> select current_user()

How To Get The Current Database Name In MySQL

I just upgraded my WordPress installation to 2.6.3 and have a few tips to blog about for all of you Google searchers.

To find the current database in a MySQL prompt, type the following:

mysql> select database();