Summary of differences between MySQL host 127.0.0.1 and localhost, mysqllocalhost
1. mysql-h 127.0.0.1 is connected using TCP/IP. mysql server considers the connection from 127.0.0.1 or "localhost. localdomain"
2. When mysql-h localhost is used,
Many of my friends may encounter a problem. I don't know what is the difference between 127.0.0.1 and localhost. However, sometimes I find that the connection fails when I use localhost, but I changed it to 127.0.0.1, so what are their differences?
1. When mysql-h 127.0.0.1, using TCP/IP connectivity, MySQL server considers the connection to be from 127.0.0.1 or "Localhost.localdomain"
2. When mysql-h localhost, it is not connected with TCP/IP and uses UNIX sockets; At this time, MySQL server
1. Mysql-h 127.0.0.1, when using TCP/IP connection, MySQL server considers the connection to be from 127.0.0.1 or "Localhost.localdomain"2. When mysql-h localhost, it is not using TCP/IP connection, but the use of UNIX sockets, at this time, MySQL
PHP links MySQL host 127.0.0.1 and localhost
PHP links MySQL host 127.0.0.1 and localhost
Use mysql-u root-p to enter the MySQL operation interface
You can directly use/usr/local/php5/bin/php/web/test. php to connect to the database.
Apache is
Error: 1130-host... is not allowed to connect to this MySql server opens mysql remote connection without using localhost, 1130-hostlocalhost
Error: 1130-host... is not allowed to connect to this MySql server
Solution:
1. Change the table.
It may be
Error: 1130-host allowed to connect to this MYSQL serverWorkaround:1. Change the table method.It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as the computer on the localhost, log in to MySQL,
Error: 1130-host allowed to connect to this MySQL server open MySQL remote connection does not use localhostWorkaround:1. Change the table method.It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as
Issue: Navicat for MySQL error when opening link: 2005-unknown mysql server host ' localhost ' (0)?When using Navicat to connect to MySQL database: MySQL error 2005-unknown mysql server host ' localhost ' (0) error;When checking the connection
Workaround:1. Change the table method.It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as the computer on the localhost, log in to MySQL, change the "MySQL" Database in the "User" table "host",
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.