mysql admin commands

set password:

# mysqladmin -u root -p password 'new-password'

# mysqladmin -u root -h <hostname> -p password 'new-password'

create a user

grant all privileges on dbname.* to user@localhost IDENTIFIED BY 'pass';
grant alter, create, delete, drop, index, insert, select, update 
on dbname.* to username@localhost identified by 'pass';

backup and restore

The most normal use of mysqldump is probably for making a backup
of whole databases. 

mysqldump --opt database > backup-file.sql

You can read this back into MySQL with:

mysql database < backup-file.sql

mysql admin program

mysqladmin is a utility for performing administrative operations, such as creating or dropping databases, reloading the grant tables, flushing tables to disk, and reopening log files. mysqladmin can also be used to retrieve version, process, and status information from the server.

# mysqladmin 

# mysqladmin -u root status

Create a new database from an old one:

mysqladmin -u user create newdb
mysqldump -u user --opt oldb | mysql -u user newdb

You will still have to transfer users to the new db!