LAMP 3.2 MySQL Login

Source: Internet
Author: User

When the MySQL service starts, not only listens to the Ip:port, but also listens to a socket, our installation mysql is the monitor
Listen to the/tmp/mysql.sock. If PHP is local, then PHP and MySQL communication can be communicated through the socket, such as
If the result is remote, it needs to communicate via TCP/IP. Under the Linux command line, we can use the following method to connect the
Connect to the MySQL server.

(1) How TCP/IP is

mysql-uroot-h192. 168.1. 117 -p3306-p123456

-H Specify IP

-P Specify port

-P Specify password

If the error says: Do not allow the link MySQL server, the IP to 127.0.0.1 to try, because has been authorized. Now give 192.168.1.117 authorization.

Enter in the MySQL command

' Root ' @'192.168.1.117'123456';

All so the permissions

*. * Library. Table

Authorization to Root

Client IP server is 117, customer service may be 116 115

Finally with the password

Select a bit

Select Database

Use MySQL
Select  from where host='192.168.1.117'\g;

has been successfully authorized, and then to link

mysql-uroot-h192. 168.1. 117 -p3306-p123456

View the currently logged on user

Select User ();

(2) Socket mode

This is only suitable for connecting to the native MySQL, the command is:

Mysql-uroot-s/tmp/mysql.sock-pwangshaojun

LAMP 3.2 MySQL Login

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.