Linux MySQL backup import

Source: Internet
Author: User

Connect to a remote Linux database

Mysql-hip-u User name-p password


mysql-h192.168.1.180-uroot-p123456


What databases are listed

show databases;


Create a database

Create DATABASE xxx;


Switch database

Use XXX database;


List all tables in the database

Show tables;


Backing Up the database

Mysqldump-hip-u User name-p password database name > backup path

mysqldump-h192.168.1.180-uroot-p123456 lmcms_160718 >/usr/local/119_sql_bak_liuzhen/119_lmcms_ 160718.2016-7-31.bak


Import Database

The first way: Mysql-hip-u username-p Password Database < backup address

mysql-h192.168.1.180-uroot-p123456 lmcms_160718 < 46_119_lmcms_160716.2016-7-18.bak


Second way: source Backup Address


View table Structure

Show CREATE TABLE Cms_user;


This article from "Liu" blog, reproduced please contact the author!

Linux MySQL backup import

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.