MySQL Commands1 PDF
MySQL Commands1 PDF
MySQL Commands1 PDF
__ __ ____ ___ _
| \/ |_ _/ ___| / _ \| |
| |\/| | | | \___ \| | | | |
| | | | |_| |___) | |_| | |___
|_| |_|\__, |____/ \__\_\_____|
|___/
Dump all databases for [mysql dir]/bin/mysqldump -u root -ppassword --opt >/tmp/alldatabases.sql
backup. Backup file is
sql commands to
recreate all db's.
Dump one database [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename
for backup. >/tmp/databasename.sql
Dump a table from a [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename >
database. /tmp/databasename.tablename.sql
Restore database (or
database table) from [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql
backup.
CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial
VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),
Create Table Example
officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email
1.
VARCHAR(35),phone VARCHAR(25), groups
VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));
create table [table name] (personid int(50) not null auto_increment primary
Create Table Example
key,firstname varchar(35),middlename varchar(50),lastname varchar(50) default
2.
'bato');