lecture8 - CPSC431Lecture8 MysqladminCommands...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CPSC431 Lecture 8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Mysqladmin Commands  %>mysqladmin -u root -p variables Enter password: create databasename : Creates a new database, the name of which is specified by databasename. drop databasename : Deletes an existing database, the name of which is specified by databasename. extended-status: Provides extended information regarding the server status. flush-logs: Closes and reopens all logging files. flush-status: Resets status variables, setting them to zero. flush-tables: Closes all open tables and terminates all running table queries. flush-threads: Purges the thread cache. flush-privileges: Reloads the privilege tables. If you're using the GRANT and REVOKE commands rather than directly modifying the privilege tables using SQL queries, you do not need to use this command. kill id[,id2[,id N ]]: Terminates the process(es) specified by id, id2, through id N . password new-password : Changes the password of the user specified by -u to new-password using the post-MySQL 4.1 password-hashing algorithm.
Background image of page 2
Mysqladmin Commands ping: Verifies that the MySQL server is running by pinging it, much like a Web or mail server might be pinged. processlist: Displays a list of all running MySQL server daemon processes. reload: Alias of the command flush-privileges. refresh: Combines the tasks carried out by the commands flush-tables and flush-logs. shutdown: Shuts down the MySQL server daemon. status: Outputs various server statistics. start-slave: Starts a slave server. This is used in conjunction with MySQL's replication feature. stop-slave: Stops a slave server. This is used in conjunction with MySQL's replication feature. variables: Outputs all server variables and their corresponding values. version: Outputs version information and server statistics.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Other Utilities mysqldump %>mysqldump [ options ] database [ tables ] %>mysqldump [ options ] --databases [ options ] database1 [ database2 ...] %>mysqldump [ options ] --all-databases [ options ] Dumps just the table structures %>mysqldump -u root -p --all-databases --no-data > backup-structures.sql Dumps just the data of a single database, corporate %>mysqldump -u root -p --no-create-info corporate > backup-structures.sql Dumps both the structure and the data of two tables %>mysqldump -u root -p --add-drop-table corporate product staff > bk.sql
Background image of page 4
The Other Utilities mysqlshow mysqlshow [ options ] [ database [ table [ column ]]] View a list of all available databases: %>mysqlshow -u root –p View all tables in a particular database, such as mysql: %>mysqlshow -u root -p mysql View all columns in a particular table: %>mysqlshow -u root -p mysql db
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Other Utilities mysqlhotcopy %>mysqlhotcopy [options] database1 [/path/to/target/directory] %>mysqlhotcopy [options] database1. ..databaseN /path/to/target/directory %>mysqlhotcopy [options] database./regular-expression/ Make a copy of the corporate database %>mysqlhotcopy -u root -p corporate mysql /usr/local/mysql/backups
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

lecture8 - CPSC431Lecture8 MysqladminCommands...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online