CentOS Lamp The first part-environment build Linux Software removal method, MySQL installation, 19th session
The first half of the class
How to remove Linux software
MySQL Installation
The second half of the class
Apache Below a software httpd, you will httpd mistakenly think that is Apache
Sohu Image: Http://mirrors.sohu.com
Kangsheng statue: http://www.aminglinux.com/study_v2/download.html
How to remove Linux software
SOURCE Package Delete: Delete directory directly
RPM Delete: rpm-e
Yum Delete Yum Remove
Download MySQL
/USR/LOCAL/SRC Source Package Placement Place
Binary free Compiler package: mysql-5.1.40-linux-i686-icc-glibc23.tar.gz
wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz//Hong Sing address
Note: The above address is for 32-bit machines, if your machine is 64-bit, download this package (http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-x86_64- ICC-GLIBC23.TAR.GZ) installation method is the same.
mysql-5.1.40-linux-i686-icc-glibc23.tar.gz//ICC means to compile with GCC
Skip-networking does not allow MySQL to listen on Port 3306, only with local UNIX sockets
Connect the database locally with/tmp/mysql.sock without TCP/IP
Steps:
Tarzxvf/usr/local/src/mysql-5.1. +-linux-i686-icc-glibc23.Tar. GZ//Download the compile-free installation packageMVmysql-5.1. +-linux-i686-icc-glibc23/usr/local/MySQL useradd-s/sbin/nologin MySQL//new MySQL user CD/usr/local/MySQLmkdir-p/data/MySQL//New database Data directoryChown-R mysql:mysql/data/MySQL//change data directory belonging to the main group./scripts/mysql_install_db--user=mysql--datadir=/data/MySQL//initializationCPsupport-files/my-large.cnf/etc/MY.CNF//Copy configuration file
VI/ETC/MY.CNF//Modify configuration fileCPsupport-files/mysql.server/etc/init.d/mysqld//Copy startup script
VI!$//Modify startup script Basedir=/usr/local/mysql, Datadir=/data/mysqlchmod 755/etc/init.d/mysqld//Change startup script permissions Vim/etc/init.d/mysqld #修改datadirchkconfig--add mysqld chkconfig mysqld on//Join to System Services list and set startup level service Mysqld start//start MySQL
Ps-aux|grep MySQL//whether there is a MySQL process
Netstat-lnp|grep 3306
MySQL Initialization
F
CentOS Lamp Part I-Environment building 19th class