Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Use the command line MySQL database backup and recovery     - Android code performance optimization tips (Programming)

- Java look and feel mode (Facade mode) (Programming)

- How to install Ubuntu California - the calendar application (Linux)

- lack of SWAP space during installation of Oracle (Database)

- Redhat 7 modify the default run level method --RHEL7 use systemd to create a symbolic link to the default runlevel (Linux)

- TNS-03505 name could not be resolved (Database)

- Linux Oracle delete archived logs (Database)

- Eclipse 3.7.2 can not start solving under Ubuntu 14.04 (Linux)

- Ubuntu amend resolv.conf restart failure problem (Linux)

- EXP-00091 Error resolved (Database)

- To install MySQL 5.6 binary packages under CentOS 6.4 64bit (Database)

- PostgreSQL-XL installation and deployment (Database)

- Java to achieve local fileCopy (Programming)

- AWR Report (Database)

- Oracle database NUMBER (x, y) data types (Database)

- To install JDK1.7 and compiler Hadoop-2.7.1 under CentOS7 (Server)

- Efficient running Linux virtual machine Six Tips (Linux)

- Oracle rebuild index script (Database)

- VMware ghost Linux card error (Linux)

- Android Activity launchMode (Programming)

 
         
  Use the command line MySQL database backup and recovery
     
  Add Date : 2018-11-21      
         
         
         
  Use the MySQL command line can be achieved on the database backup and recovery, here to introduce you to use the MySQL command detailed process steps to achieve the function of the line for your reference.

MySQL command line to export the database:
1, bin files into the MySQL directory folder: cd MySQL bin directory to the folder
As I entered the command line: cd C: \ Program Files \ MySQL \ MySQL Server 4.1 \ bin
(Or directly add the directory path of the windows environment variable)

2, export the database: mysqldump -u username -p database name> exported file name
As I entered the command line: mysqldump -u root -p news> news.sql (after entering into the MySQL will let you enter the password)
(If you export a single table, then you can enter the name of the table after the database name)

3, you will see the next file is automatically generated to bin file news.sql

MySQL command line into the database:

1, .sql files will be moved to the bin file import under this path more convenient
2, with the above derived in step 1
3, enter MySQL: mysql -u username -p
As I entered the command line: mysql -u root -p (enter the same post will let you enter the MySQL password)
4, you have to build a new database in MySQL-Front, the case is an empty database, such as the new target database called the news
5, enter: mysql> use the target database name
As I entered the command line: mysql> use news;
6, import file: mysql> source filename to import;
As I entered the command line: mysql> source news.sql;

MySQL backup and restore, are using mysqldump, mysql and source commands to complete.
1.Win32 under MySQL backup and restore
Backup 1.1
Start Menu | Run | cmd | use "cd \ Program Files \ MySQL \ MySQL Server 5.0 \ bin" command to enter the bin folder | use "mysqldump -u username -p databasename> exportfilename" export the database to a file, such as mysqldump -u root -p voice> voice.sql, then enter the password to start the export.
  
Restore 1.2
Into the MySQL Command Line Client, enter the password, go to "mysql>", enter the command "show databases;", Enter, see what the database; to build your database to be restored, enter "create database voice;", carriage return ; switches to the newly created database, enter "use voice;", enter; import data, enter "source voice.sql;", the transport, import, appears "mysql>" prompt again and no error that is successful restore.
  
2.Linux under MySQL backup and restore
Backup 2.1
[Root @ localhost ~] # cd / var / lib / mysql (into the MySQL database directory, according to their own situation to adjust MySQL installation directory)
[Root @ localhost mysql] # mysqldump -u root -p voice> voice.sql, enter the password.
Restore 2.2
Method One:
[Root @ localhost ~] # mysql -u root -p Enter, enter a password, enter the MySQL console "mysql>", with 1.2 reduction.
Act II:
[Root @ localhost ~] # cd / var / lib / mysql (into the MySQL database directory, according to their own situation to adjust MySQL installation directory)
[Root @ localhost mysql] # mysql -u root -p voice < voice.sql, enter the password.
     
         
         
         
  More:      
 
- Ubuntu 14.04 How to set up an SSH without password (Linux)
- Ubuntu 14.04 / 14.10 how to install FFmpeg 2.5.1 (Linux)
- Redis is installed in Ubuntu 14.04 (Database)
- GCC and gfortran write MEX program (Matlab2012a) under Ubuntu 14.04 (Programming)
- GRUB and Linux system repair (Linux)
- Netapp storage routine inspections and information gathering (Linux)
- Linux hard drive failure Case Studies (Linux)
- To install PostgreSQL 9.4 (Database)
- JavaScript is implemented without new keywords constructor (Programming)
- Linux rename command usage in learning to modify the file name (Linux)
- Distributed Firewall Design on Linux platform (Linux)
- BCP importing and exporting large amounts of data Practice (Database)
- Linux garbled file delete method (Linux)
- MySQL various log summary (Database)
- Ubuntu buffalo wzr-hp-300nh brush DD-WRT router system (Linux)
- Linux --- process handle limit summary (Linux)
- Java class HashSet (Programming)
- Method under Linux GCC Compiler shared library function export control (Programming)
- Virtual Judge structures under Ubuntu 14.04 (Server)
- Android media library of analysis: MediaProvider (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.