Figure-LAMP
LampPlatform Construction: linux + apache + mysql + PHP
1. Install mysql-5.1.36
Software acquisition:
Http://dev.mysql.com/downloads/
Installation steps:
Tar xvfz mysql-5.1.36.tar.gz
Cd mysql-5.1.36
./Configure-prefix =/usr/local/mysql \
-With-extra-charsets = all \
-Sysconfdir =/usr/local/mysql/etc \
-Localstatedir =/var/lib/mysql \
-With-unix-socket-path =/usr/local/mysql/var/mysql. sock \
-With-charset = gbk \
-With-collation = gbk_chinese_ci
(Loading gbk and gbk_chinese_ci can handle Chinese garbled characters)
Make
Make install
(Note. -localstatedir =/var/lib/mysql is added to/configure, but the mysql directory is not generated under/var/lib, therefore, after compiling and installing the source code package, check whether this directory exists. If not, manually create one: mkdir/var/lib/mysql)
Groupadd mysql
Useradd-g mysql-d/home/mysql-s/bin/bash-c "MySQL user" mysql
(To ensure security, we create a common user to initialize the database. The main directory of mysql is/usr/local/var, and this user cannot log on to the server .)
Cp/usr/local/mysql/share/mysql/my-large.cnf/etc/my. cnf
Cd/usr/local/mysql
./Bin/mysql_install_db-user = mysql
(Initialize the database. database files will be generated under/var/lib/mysql. This step is not required for upgrade .)
Chown-R root: mysql.
Chown-R mysql: mysql/var/lib/mysql
/Usr/local/mysql/bin/mysqld_safe &
(Start the server, & indicates running in the background. This command will not be used for subsequent startup. Use the mysql. server startup file in/usr/local/mysql/share/mysql/to start later .)
/Usr/local/mysql/bin/mysql-u root-p
(If there is no password, use/usr/local/mysql/bin/mysql)
Cp/usr/local/mysql/share/mysql. server/etc/init. d/mysql
Chmod 755/etc/init. d/mysql
Then you can run service mysql start, service mysql restart, or service mysql stop to start or stop the MySQL service. /Etc/init. d/mysql start is also supported.
Chkconfig mysql on
Chkconfig-add mysql
Chkconfig-level 345 mysql on
(Set to automatically start the MySQL service at startup)
Check whether port 3306 is Enabled:
Netstat-atln
Set the MySQL root Password (non-system root ):