Connect to the Mysql server remotely.

Source: Internet
Author: User

Connect to the Mysql server remotely.

1. Command Line: C:/> mysql-h 192.168.0.53-P 3306-u vicky-padmin

The local computer is Windows 7, and the remote computer room is Linux.

192.168.0.53 is the IP address of my remote linux system. After the connection is successful, "mysql>" appears"


Solutions to problems:

1.Can't connect to MYSQL server on '192. 168.0.53 ';

Possible causes:

1. the MYSQL service is not started.

Open the mysql service on the remote computer.

Port 2.3306 only takes effect locally and does not support remote access. You can check the status of port 3306.

Netstat-anp | grep 3306. It can be seen that port 3306 is only open to the local device.

Under normal circumstances, mysql only listens to port 3306 on the IP address 127.0.0.1, and denies access from other IP addresses (you can view it through netstat. (To cancel the local listening, modify the my. cnf file :):
Sudo vi/etc/mysql/my. cnf
Bind-address = 127.0.0.1 // locate this content and comment

2.Acess denied for user 'root' @ '192. 168.0.70 '(using password: Yes ).


Possible cause: the root account has insufficient permissions. It may only be used locally and cannot be remotely logged on.

Check the account and account scope in the database. The root account can only take effect locally.


We can create an account that can remotely log on to Mysql from other IP addresses. Here, I simply set up an account that can connect to the mysql server from any host.

Grant all privileges on *. * TO 'vicky' @ '%' identified by 'admin' WITH GRANT OPTION






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.