How to migrate a mysql database from windows to linux or from linux to windows

Source: Internet
Author: User

1. Export the. SQL file, open the doscommand line, run cd to enter the bin directory of mysql, and run

Mysqldump-uroot-p your Password Database Name> D:/export file name. SQL
For example:

Mysqldump-uroot-p123456 listener> D:/listener. SQL

Ii. log on to mysql in linux

Upload listener. SQL to the system root directory or another directory.

Run

Mysql-uroot-p123456-Dtest <d: \ test \ ss. SQL

I directly access mysql, select the database, use listener, and then execute

Source/listener. SQL

Then complete (listener. SQL is placed in the linux root directory, so use /)

Query OK, 0 rows affected (0.00 sec) Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.00 sec) query OK, 1 row affected (0.00 sec) Query OK, 24 rows affected (0.01 sec) Records: 24 Duplicates: 0 Warnings: 0

Similarly, migrating mysql Data from linux to windows is the same.


Related Article

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.