# Download source files wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/ftp://ftp.ntu.edu.tw/pub/MySQL/ # or wget ftp://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz # Create users and Groups # Build a MSYQL user and group Groupadd MySQL useradd-g MySQL mysql-s/usr/sbin/nologin # Create installation directory Mkdir-p/usr/local/webserver/mysql # CREATE DATABASE Directory Mkdir-p/home/mysql/3306/data # decompression TAR-ZXVF mysql-5.5.17.tar.gz CD mysql-5.5.17 # Compile and install MySQL # CMake, the parameters can not be so much, as long as a-dcmake_install_prefix=/usr/local/webserver/mysql on the line, we can configure in MY.CNF. [Mysqld] In the content, look at your copy after the my.cnf there are no these settings, there is no need to set up. Cmake-dcmake_install_prefix=/usr/local/webserver/mysql -dmysql_datadir=/home/mysql/3306/data -ddefault_charset=utf8 -dwith_readline=1 -dwith_ssl=system -dwith_embedded_server=1 -denabled_local_infile=1 -ddefault_collation=utf8_general_ci -dwith_myisam_storage_engine=1 -dwith_innobase_storage_engine=1 -dwith_memory_storage_engine=1 -dwith_debug=0 # install MySQL Make && make install # If you need to change the configuration Make clean Rm-f CMakeCache.txt # Copy configuration file CP SUPPORT-FILES/MY-MEDIUM.CNF/USR/LOCAL/WEBSERVER/MYSQL/MY.CNF # Set permissions chmod +x/usr/local/webserver/mysql Chown-r Mysql.mysql/usr/local/webserver/mysql # Configure power-on Self-starter Cp/usr/local/webserver/mysql/support-files/mysql.server/etc/init.d/mysql chmod +x/etc/init.d/mysql Chkconfig–list UPDATE-RC.D mysql defaults '/sbin/chkconfig–add MySQL; /sbin/chkconfig MySQL on ' Chkconfig–list MySQL # Modify MY.CNF Configuration Vim/usr/local/webserver/mysql/my.cnf # [MYSQLD] Add: Datadir=/home/mysql/3306/data Default-storage-engine=myisam # The following options are available: Log-error =/home/mysql/3306/data/error.log Pid-file =/home/mysql/3306/data/mysql.pid user = MySQL Tmpdir =/tmp # Install default datasheet /usr/local/webserver/mysql/scripts/mysql_install_db–basedir=/usr/local/webserver/mysql–datadir=/home/mysql/ 3306/data–user=mysql # start MySQL /USR/LOCAL/WEBSERVER/MYSQL/BIN/MYSQLD_SAFE–DEFAULTS-FILE=/USR/LOCAL/WEBSERVER/MYSQL/MY.CNF & # or use # The last "&" means running in the background /etc/init.d/mysql Start (service MySQL start) # test whether MySQL starts # 1 To see if there is process MySQL Ps-ef | grep MySQL # 2 To see if the port is running NETSTAT-TNL | grep 3306 # 3 Read MySQL version information /usr/local/webserver/mysql/bin/mysqladmin version # so far, MySQL installation complete |