Article Title: Summary of LAMP environment setup. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Install Mysql
1. Install ncurses-devel-5.5-24.20060715.i386.rpm first
# Rpm-ivh ncurses-devel-5.5-24.20060715.i386.rpm
2. Create an msyql User Group
[Root @ localhost ~] # Grep mysql/etc/group
# Check whether the user group mysql exists in the query system. If no user group exists, add it.
[Root @ localhost ~] # Groupadd mysql
# Add a user group named mysql
3. Create a mysql user
[Root @ localhost ~] # Grep mysql/etc/passwd
# Check whether the user mysql exists in the query system. If the user does not exist, add the user.
[Root @ localhost ~] # Useradd mysql-g mysql-M-s/sbin/nologin
# Add a user named mysql.
-G: Specifies the user group to which the new user belongs)
-M: do not create a root directory
-S: defines the shell it uses./sbin/nologin indicates that the user cannot log on to the system.
4. decompress: mysql
[Root @ localhost ~] # Cd/usr/local/src/
[Root @ localhost src] # tar-zxvf mysql-5.0.27.tar.gz
#...... (Omitted information )......
# Decompress
3. Set compiler compilation Parameters
[Root @ localhost src] # cd/usr/local/src/mysql-5.0.27
[Root @ localhost mysql-5.0.27] #
./Configure -- prefix =/usr/local/mysql -- with-unix-socket-path =/tmp/mysql. sock -- localstatedir =/usr/local/mysql/data \
-- With-charset = gbk -- without-debug -- enable-Cycler -- without-isam \
-- With-client-ldflags =-all-static -- with-mysqld-ldflags =-all-static -- enable-thread-safe-client
# These settings tell the compiler how to compile apache:
? Prefix =/usr/local/mysql
Specify the msyql installation directory
? With-unix-socket-path =/tmp/mysql. sock
This specifies the location and file name of the online socket file after the mysql server is started.
? Localstatedir =/usr/local/mysql/data
Specify the mysql database directory
? With-charset = gbk
Added support for gbk Chinese Characters
? Without-debug
Remove debug mode
? Enable-Cycler
Use the assembly version of some character Functions
? Without-isam
Removed the isam table type support and is rarely used now. The isam table is a platform-dependent table.
? With-client-ldflags =-all-static
? With-mysqld-ldflags =-all-static
5. Compile and install
[Root @ localhost mysql-5.0.27] # make
# The "make" command compiles the source file into executable binary files.
[Root @ localhost mysql-5.0.27] # make install
# "Make install" install binary files and configuration files in the appropriate directory
6. initialize the system library
[Root @ localhost mysql-5.0.27] #./scripts/mysql_install_db
7. other settings
[Root @ localhost mysql-5.0.27] # cp support-files/my-medium.cnf/etc/my. cnf-fv
# Note:
-F: delete a file or directory with the same name in the target without any prompt.
# There are some other my. cnf configuration files. Suitable for different application scales. The type is my-*. cnf. Cp according to your needs.
[Root @ localhost mysql-5.0.27] # cp support-files/mysql. server/etc/init. d/mysqld
# Add to startup script
[Root @ localhost mysql-5.0.27] # chmod 700/etc/init. d/mysqld
[Root @ localhost mysql-5.0.27] # cd/usr/local
[Root @ localhost local] # chmod 750 mysql-R
# Note:
-R recursively changes the permissions of directories and their contents.
[1] [2] [3] [4] Next page