Home > Database > Mysql Tutorial > How to use mysql command to import and export sql files under Linux

How to use mysql command to import and export sql files under Linux

WBOY
Release: 2023-05-26 12:16:06
forward
1833 people have browsed it

During daily development, import and export operations of the database cannot be avoided.

How to use mysql command to import and export sql files under Linux

Use the command directly:

 mysqldump -u root -p abc >abc.sql
Copy after login

Then press Enter to enter the password;

mysqldump -u database link username -p Target database> The stored file name

The file will be exported to the current directory

Import database (sql file)

mysql -u username-p database name mysql - u abc -p abc

Note that the sql file must be in the current directory. If it is not in the current directory, it needs to be in

The above is the detailed content of How to use mysql command to import and export sql files under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template