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.