In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MySQL's mysqldump Concise Common Command Guide
Export data
1. Back up the data and table structure of all databases
Mysqldump-uroot-ppassword-A > all.sql
2. Only backup table structure, do not back up data
Mysqldump-uroot-ppassword-A-d > database.sql
3. Only back up the database, not the table structure
Mysqldump-uroot-ppassword-A-t > data.sql
4. Back up the data and table structure of a single database (only backup data or table structure can be-t or-d)
Mysqldump-uroot-password dbname > dbname.sql
5. Back up the data and table structure of multiple databases at once (only backup data or table structure can be-t or-d)
Mysqldump-uroot-ppassword db1 db2 > db2.sql
Import data
1. Import data directly through command redirection
Mysql-uroot-ppassword
< all.sql 2、在mysql终端source文件 mysql -uroot -ppassword mysql>Source all.sql
3. Restore a single database (you can also source through the mysql terminal)
Mysql-uroot-ppassword db1
< db.sql 注意:郑州较好的妇科医院 http://www.kd0371.com/ 导入数据的时候,要先确认一下sql文件是否包含建表建库语句,不然会导致导入失败。 压缩ibdata1空间的方法: 对一些没用的表进行清空: truncate table xxx; 然后optimize table xxx; 对压缩ibdata1空间没有效果,因为对共享表空间不起作用。mysql ibdata1存放数据,索引等,是MYSQL的最主要的数据。 简明压缩ibdata1的方法是采用mysqldump备份所有数据库后重建所有数据库,步骤如下: mysqldump -uroot -ppassword --all-databases >Backup.sql exports the data and table structure of all databases
Stop the MySQL service service.
Delete ibdata1, ib_logfile0 and ib_logfile1 files.
Restart the MySQL service service.
Import all backup data and table structure mysql-uroot-ppassword < backup.sql.
In this way, the three files of ibdata1, ib_logfile0 and ib_logfile1 will be re-established, and the storage space will be greatly reduced.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.