Enable MySQL remote access in Ubuntu and migrate data from another database server to a new server

Source: Internet
Author: User

First, turn on the Mys remote access function

1. Enter the server input Netstat-an | grep 3306 confirms that 3306 is open to the outside, MySQL default state is not open access function. If the port is not open after entering the above command, it will be displayed

<strong> display results: TCP 0 0 127.0.0.1:3306 0.0.0.0:*listen</strong>

2, from the above results can be seen, MySQL 3306 port is only listening to local connections, which prevents external IP access to the database, so you need to modify the MySQL configuration file,

Enter VIM/ETC/MYSQL/MY.CNF and then enter to find bind-address = 127.0. 0.1, comment it out (just add a # to the top of the note), and the MySQL remote access port is turned on.

3, login MySQL, enter mysql-u root-p return

4. Enter Grant all on *. * to [e-mail protected]'% ' identified by ' your password ' with GRANT option (% means wildcard), this command grants the user right to access m Any database and table in the Ysql

5, restart MySQL can telnet to the database server, input/etc/init.d/mysql restart enter;

6. Add remote access permissions to the root user:

    1. MySQL >use MySQL; Log in to MySQL
    2. Mysql>update User Set host = '% ' where user = ' root '; Modify Host
    3. mysql> flush Privileges; Refresh

This allows remote access to the MySQL database.

Second, data migration

1. Connect the source database and the target database with Navicat

2, on the source database right click on the data transfer Select a good source database, and then select a good target database address, click to start the data can be migrated past.

Enable MySQL remote access in Ubuntu and migrate data from another database server to a new server

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.