MySQL. Sock file problems encountered during MySQL installation in Linux

Source: Internet
Author: User
Environment: Red Hat as 4 + MySQL 5.0.37 + PhP 5.2 + Apache
The first installation of MySQL in Linux experienced a "torment", and it was always impossible to find/tmp/MySQL. the sock file is used to query information online, and the information is ln/var/lib/MySQL. sock/tmp/MySQL. sock, and modify/etc/My again. when PHP calls mysql_connect (), a warning still appears, and LN does not work (note: the preceding method basically finds at least one MySQL on the disk after MySQL is started. sock file, because MySQL. sock is generated after MySQL is started and does not exist if it is not started. Due to multiple installation times, I may have started the MySQL process and re-compiled it, MySQL. sock disappears somehow, and a new MySQL is required. sock must be restarted from mysql.) I don't know why, maybe it's too impatient. I Just reload it several times and finally connect to MySQL. no sock files can be found, and the solution is as follows:
1.
# Ps-Aux | grep MySQL
Find the MySQL process.
# Kill MySQL process number
Confirm all kill light

2. Skip Step 1 directly. If this step is invalid, use step 2.
/Usr/local/MySQL/bin/mysqld_safe -- user = MySQL & start MySQL.
Bin/MySQL-u root-p log on to MySQL

3.
Restart the MySQL service and run it in the MySQL installation directory.
# Service mysqld start

4. I checked a bunch of information about Apache and MySQL self-starting after Linux restart, but it was useless. I came up with a simple method:
Add the following statement to the/etc/rc. d/rc. Local file:
/Usr/local/Apache/bin/apachectl start
Service mysqld start
Both of them can start birds together with Linux...
The above is directly started as a root user. There are many ln methods on the network, which I don't know yet. Try again later.

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.