C # remote access to MySQL Databases in Linux (Ubuntu) or Windows

Source: Internet
Author: User
1. Remote database access model 2. How to Set MySQL on WIN7 and Linux: 2.1. Assign permissions (Linux and WIN7) for MySQL command lines, assign permissions, and execute GRANTALLPRIVILEGESON *. * TO 'Lucy '@' 192. 168.1.102 'identifiedby '123' WITHGRANTOPTION; ALLPRIVILEGES allocation

1. approximate model of remote database access

2. How to configure MySQL in Windows 7 and Linux:

2.1. Assign permissions (Linux and WIN 7)

Execute the MySQL command line to assign permissions and execute

Grant all privileges on *. * TO 'Lucy '@ '192. 168.1.102' identified by '20140901' with grant option;

All privileges assigns ALL permissions, such as Select, Insert, Delete, Update, Drop, and Create.
*. * It is a table in the database. database.
'Lucy 'is the username required by the remote host to access the computer. (mysql assigns the user to the remote host. Of course, you must use port 3306 in the following step)
'192. 168.1.102 'is the IP address of the remote host (which IP address of the remote host can be accessed by mysql)
'000000' indicates the user password that the remote host knows and needs to access (this is also the password allocated to the remote host by mysql)
Therefore, it can be summarized

Grant all privileges on database. database table TO 'remote machine Username '@ 'remote machine IP address' identified by 'remote machine user password' with grant option;

2.2 Open Port 3306

2.2.1 why port 3306 should be enabled?

Because of firewall problems, such:

After ASP is configured in IIS, the local area network host cannot access the webpage of the Local Machine (if the default port is 80), and you can turn off the firewall. Because port 80 is not enabled.

Mysql's default port 3306 is disabled by default.

2.2.2. Why do we not need to open a port when accessing SQL remotely?

Because the SQL port is opened by default, you only need to know its user name, password, and port number 1433 when you remotely access the SQL database.

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.