An error occurred while the MYSQL connection port was occupied by the introduced file path.

Source: Internet
Author: User
Tags mysql command line

An error occurred while the MYSQL connection port was occupied by the introduced file path.

This morning, I plan to use Wampserver to build the PHP environment and configure my own program. After downloading the latest wampserver 3.0.6 for installation, I found that mysql has been unable to run and thought it was a problem with the wampserver version. Then I downloaded the related versions such as 2.4 and 2.5 for installation, which is still unsolved, the main cause is that the mysql command line does not respond after you enter the password and press enter, and then the command line disappears automatically. In addition, if you enter the password in PHPMyAdmin, the connection times out or a connection failure error occurs. Later, I uninstalled wampserver directly, switched to phpStudy to build the environment, started after installation, and started Apache normally, but mysql started to prompt that the port was occupied. The cause of the problem was finally found, the real reason why mysql cannot be connected is that the local port 3306 is occupied. Then, right-click the phpStudy icon in the lower right corner and choose phpStudy Settings> general port settings to change the mysql port to 3305, then save and restart, and the problem is solved perfectly. In addition, set the bound domain name and path in the local phpStudy and then modify the host file. Your program configuration is successful.

When you modify a PHP program in the afternoon, place the program in phpStudy, configure the path domain name and host file, modify the database connection file, and cause a path error when running the program, because the program is obtained from the LINUX server, the file path contained in the program must be modified correctly. The include_once statement contains and runs the specified file during script execution, which is similar to the include statement, the only difference is that if a file already exists, it will not be contained again. Such a statement name implies that it will only be contained once. Include_once can be used when the same file may be contained more than once during script execution. To ensure that it is only included once, you can avoid function redefinition and variable re-assignment. If the path contains an error, the file cannot be found. After modifying the path of the file, run the task again. The path error disappears. I tried to register a member and went to the white screen on the database Writing Page. I didn't respond for a long time. After a while, I was prompted that the connection had timed out. At this time, I guess it was still a problem with the connection port, so I modified the database connection statement $ db = new ezSQL_mysql ('root', 'root', 'sd', 'localhost: 3305 ') to configure the port, run the program again and register the member.

In addition, the local database allows remote access. You only need to use Navicat to connect to the database and then select a user to change the user's host to a percent sign.

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.