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:
- MySQL >use MySQL; Log in to MySQL
- Mysql>update User Set host = '% ' where user = ' root '; Modify Host
- 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