In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to import and export mysql database in linux", the content is simple and easy to understand, clear organization, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to import and export mysql database in linux" this article bar.
1. Export the database with the mysqldump command (note the installation path of mysql, that is, the path of this command):
1. Export data and table structure:
mysqldump -u username-p password database name> database name.sql
/usr/local/mysql/bin/ mysqldump -uroot -p abc > abc.sql
Enter will prompt for password
2. Export only table structure
mysqldump -u username-p password-d database name> database name.sql
/usr/local/mysql/bin/ mysqldump -uroot -p -d abc > abc.sql
Note: /usr/local/mysql/bin/ -> mysql data directory
II. Import database
First, create an empty database.
mysql>create database abc;
2. Import database
Method 1:
(1) Select database
mysql>use abc;
(2) Set database code
mysql>set names utf8;
(3) Import data (note the path of sql file)
mysql>source /home/abc/abc.sql;
Method 2:
mysql -u username-p password database name mysql -uabc_f -p abc < abc.sql It is recommended to import using the second method. Note: There is command line mode, there is sql command The above is "how to import and export mysql database in linux" all the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.