Can ' t connect local MYSQL Server though socket "/tmp" how to resolve

Source: Internet
Author: User
Tags install php

Install PHP on the openwrt, prompting so

Online a chase to find

Discover how the can ' t connect local MYSQL Server though socket "/tmp/mysql.socket" resolves

People still look for the mysql.socket, I unexpectedly directly find the TMP directory, really no language. Other people's solution using soft connection directly invalid;

Do I have to compile php myself? Think of the big head.

Continue to find the solution:

In this document

http://kong1616.iteye.com/blog/682342

I found this sentence.

In/etc/php.ini Modify the value of Mysql.default_socket, in this file, the description of the value of Mysql.default_socket is this,
;  Default socket name for local MySQL connects. If empty, uses the built-in MySQL defaults.
This value is empty at first, that is, PHP will use the default value built in MySQL if we do not take the initiative to modify it.

Really life-saving straw, my PHP program with the mysqli, and PHP.ini is configured in MySQL, so, php.ini add the following content, successfully solve the problem:

[Mysqli]mysqli.allow_local_infile=On mysqli.allow_persistent=On mysqli.cache_size= -mysqli.max_persistent= -1mysqli.max_links= -1Mysqli.default_port=3306Mysqli.default_socket=/tmp/Mysql.sock mysqli.default_host=127.0.0.1Mysqli.default_user=Root Mysqli.default_password=19870215Mysqli.connect_timeout= -Mysqli.trace_mode= Off

Can ' t connect local MYSQL Server though socket "/tmp" how to resolve

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.