Import / export. SQL file / gzip file for MySQL under Linux

    ready. SQL file and upload to server login server MySQL import. SQL file
If you need to create the database for the entire database file you don’t need to create the database for the table file
Source *.sql //.sql file path
 
3. Export. SQL file
Export table structure
It’s going to be in the data directory
cd /mysql/data/
. /bin/mysqldump -uroot -p -d newdb > Newdb.sql // newdb database name
// Enter the password
 
Export data and table structures
It’s going to be in the data directory
cd /mysql/bin/
. /bin/mysqldump -uroot -p newdb > Newdb.sql // newdb database name
// Enter the password
 

    exports the gzip file
It’s going to be in the data directory
. /bin/mysqldump -uroot -p –default-character-set=utf8 xw_taes | gzip > /home/xw_taes_1.sql.gz
// Enter the password
 

    import gzip
In any directory
gzip -d < /home/xw_taes_1.sql.gz | mysql -uroot -p xw_taes_1
// Enter the password
Xw_taes_1 is the name of the database to import
There is no meeting

 
Note: Adding plaintext password directly will report an error


Read More: