MySQL client remote connection to MySQL server

Source: Internet
Author: User
Tags mysql client

  1. Set up a MySQL server to answer ports and bind IP addresses

    • The MySQL server listens to port 3306 By default and determines the firewall to open this port.
    • Edit/ETC/MY.CNF Add the binding IP address.bind-address=192.168.42.135
    • Restart the MySQL server to view the listening status.
      [Email protected] ~]$ NETSTAT-LNT
      Active Internet connections (only servers)
      Proto recv-q send-q Local address Foreign address state
      TCP 0 0 192.168.42.135:3306 0.0.0.0:* LISTEN
  2. Create user

    CREATE USER IF not EXISTS ' ubuntu ' @ ' 192.168.42.136 ' identified by ' [email protected] ';
    192.168.42.136: For Client IP
    ubuntu: User Name
    [email protected]: Log In Password
    This user only allows the client to log in with the IP address 192.168.42.136 , and if the user wants to log on to any client, it will 192.168.42.136 change to % .

  3. Install the MySQL client (in Ubuntu, for example)

    • Apt Install mysql-client-x.x
    • Log in using the following commandmysql -h 192.168.42.135 -u ubuntu -p
      192.168.42.135: The IP address of the MySQL server

MySQL client remote connection to MySQL 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.