1. Export the entire database
Mysqldump-u username-p Database Name> exported file name
Mysqldump-u wcnc-p smgp_rj_wcnc> wcnc. SQL
2. Export a table
Mysqldump-u user name-p database name Table Name> exported file name
Mysqldump-u wcnc-p smgp_rj_wcnc users> wcnc_users. SQL
3. Export a database structure
Mysqldump-u wcnc-p-d -- add-drop-table smgp_apps_wcnc> d: wcnc_db. SQL
-D no data -- add-drop-table adds a drop table before each create statement.
4. Import the database
Common source commands
Go to the mysql Database Console,
For example, mysql-u root-p
Mysql> use Database
Then run the source command. The following parameter is the script file (for example,. SQL used here)
Mysql> source d: wcnc_db. SQL
Alan finds that source may contain garbled characters, especially in liunx.
Import the database mysql-u root-p dbmane <db. SQL;
============================================
In addition, the command for sorting out the liunx permission does not require this permission for a directory and a directory every time.
-Rwx ------: The value equal to the number indicates 700.
-Rwxr-r --: equals a number to 744.
-Rw-r-x: equals to a number indicating 665.
Drwx-x: equals to a number indicating 711.
Drwx ------: a number equal to 700 indicates.
Chmod 777/home/user single directory permission
Chmod-R 777/home/user all subdirectories