Mysql Options Database

September 2nd, 2008

Mysql Program support the following switches which you can use either the short single character or more verbose versions. Check it below;

-\?, –help Print usage information.
-d, –debug=[options] Output debug information to log. Generally ‘d:t:o,filename`. See Appendix C for further details.
-d, –debug-info Print debug messages on program exit.
-e, –exec Execute command and quit, –batch is implicit.
-f, –force Continue even if we encounter a SQL error.
-h, –hostname=[hostname] Must be followed by the name of the host you wish to connect to.
-P, –port=[port] The port to use when connecting to the MySQL database engine.
-p, –password=[password] Must be followed by the password of the user account you wish to connect with. Note there can be no space between the -p and the password.
-q, –quick Quick (unbuffered output), may slow down the server if output is suspended.
-s, –silent Tell me less please. (suppress output)
-u, –user=[user] Must be followed by the name of the user account you wish to connect to the daemon with. Not needed if the account name is the same as your login.
-v, –verbose Verbose output. The -v option may be doubled or tripled for more verbose output.
-w, –wait Wait and retry if connection fails.
-B, –batch Run in batch mode. (No prompt and no errors on STDOUT) This is automatic when reading from/to a pipe. Results will be output-ed in a tab separated format, one result line per line of output.
-I, –help Same as -\?.
-V, –version Print out version information and exit.

MySQL Admin Command

September 2nd, 2008

Once you install MySQL on your Microsoft Windows operating system, you can reach the command line by going to the Start Menu and choosing [Run]. Type the keyword  [cmd] into the text field and press Enter to launch Window’s command line interface.

Here are the command you can execute through Admin Panel ( MySQL Admin Commands);

* Statistics: [prompt]$ mysqladmin version
* List database environment: [prompt]$ mysqladmin variables
* Show if database is running: [prompt]$ mysqladmin ping
* Show databases available:

[prompt]$ mysqlshow

OR

mysql> SHOW DATABASES;

* Delete database: mysql> drop database databasename;
* Show list of active threads in server:

[prompt]$ mysqladmin -h localhost -u root -p processlist

* Delete a database: [prompt]$ mysqladmin drop database-name
* Execute SQL from Linux command line interface:
[prompt]$ mysql -h localhost -u root -p -e “select host,db,user from db” mysql
* Execute SQL command file from Linux command line interface:

[prompt]$ mysql -h localhost -u root -p database-name