Remote connection to MySQL

Source: Internet
Author: User

Use Mysqlworkbench under Windows to connect to MySQL under Ubuntu server

Install MySQL under 1.ubuntu

sudo apt-get install Mysql-server

After entering the password, you can complete the installation

2. Enter MySQL to create a remote connection user

Mysql-u root-p

Enter Password login

Create a user with Grant

Grant permission 1, permission 2,... Permission n on the database name. Table name to User name @ user address identified by ' connection password ';

For example:

Grant Select,insert,update,delete,create,drop on mydb.mytable to [e-mail protected] identified by ' MyPassword ';
Assign the user Hades from 192.168.1.88 to select,insert,update,delete,create,drop the mytable table of the database MyDB, and set the password as ' mypassword ';

Grant all privileges on * * to [email protected] identified by ' MyPassword ';

Assign the user Hades from 192.168.1.88 to all the tables in all databases and set the password to ' MyPassword ';

Grant all privileges on * * to [email protected] '% ' identified by ' mypassword ';

Assign the user Hades from any IP address the permission limit for all operations on all tables in all databases, and set the password to ' MyPassword ';

3. Modify the MySQL configuration file

sudo vim/etc/mysql/my.cf

Find bind-address = 127.0.0.1

Change to bind-address = 0.0.0.0

Save exit

4. Restart the MySQL service

sudo service MySQL restart

5. Use the Mysqlworkbench connection under window

6. The connection is shown below, if unsuccessful, check if server port 3306 is open.

Remote connection to MySQL

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.