Debugging environment: redhat9.0apache1.3.29mysql3.23.58php4.3.4i will not talk about the installation of the linux system. this is a basic achievement. in this article, other linux systems similar to Redhat should also be used. you only need to grasp the methods I provide. Remember to install R
Debugging environment: Redhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4 I will not talk about the installation of the Linux system. this is a basic achievement. This article is applicable to other linux systems similar to Redhat, you only need to grasp the methods I provide. Remember to install Redhat9. Do not install the default apache, mysql, php, and related software. Use rpm-e * to delete installed packages.
1. install Mysql3.23.58
To be honest, directly installing the rpm package provided by the official Mysql website is also a feasible measure. The rpm Package supply base on his official website is synchronized with the tar package release, I am more interested in this. at least the installation of the rpm package will not show the failure of the mysql library file in subsequent debugging. However, it is necessary to talk about the steps for custom installation. after all, there are a lot of user-defined installation steps.
Software Acquisition: [url] http://www.mysql.com/downloads/index.html#/url]
Installation steps:
Tar zxvf mysql-3.23.58.tar.gz cd mysql-3.23.58. /configure -- prefix =/usr/local/mysql -- sysconfdir =/etc -- localstatedir =/var/lib/mysqlmakemake install # prefix =/usr/local/target directory for mysql installation # sysconfdir =/etc my. ini configuration file path # Initialize the database after localstatedir =/var/lib/mysql database storage path is installed. of course, you do not need to perform this step if you upgrade the database; /usr/local/mysql/bin/mysql_install_db if the system does not have a mysql user, you 'd better do the following: useradd-M-o-r-d/var/lib/mysql-s/bin/bash-c 'MySQL server'-u 27 MySQL then I start mysql/usr/local/ mysql/bin/safe_mysqld
OK. check if mysql works properly.
Mysql-uroot mysql
Generally, the database cannot be connected normally. the error message is:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2)
In fact, most of the questions on the Internet are all titles, and the link to the question cannot be mysqld. sock. check the mysql error log to see what is going on. here, the error log is in/var/lib/mysql /*. err.
You will find that mysql cannot be started only because/var/lib/mysql does not allow mysql service access. by default, mysql calls mysql users to start the service, since you know why it cannot be started, it is simple. We only need to select chown-R mysql: mysql/var/lib/mysql. if it still cannot be started, you can debug the permission slowly. Generally, the title of the permission is not started.
If you still cannot start it, you can use my complicated permission settings. I do this every time and generally do not have a title. for details, see:
chown -R root /usr/local/mysql chgrp -R mysql /usr/local/mysql chown -R root /usr/local/mysql/bin chgrp -R mysql /usr/local/mysql/bin chgrp -R mysql /var/lib/mysql chmod 777 /var/lib/mysql chown -R root /var/lib/mysql/mysql chgrp -R mysql /var/lib/mysql/mysql chmod 777 /var/lib/mysql/mysql chown -R root /var/lib/mysql/mysql/* chgrp -R mysql /var/lib/mysql/mysql/* chmod 777 /var/lib/mysql/mysql/* chmod 777 /usr/local/mysql/lib/mysql/libmysqlclient.a