????1.1??????????MySQL?????
????1.1.1 ???????(?淶)
1 [root@Mysql_server ~]# mkdir -p /home/zhurui/tools  ##???????????????·??
2 [root@Mysql_server ~]# wget http://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.32-linux2.6-x86_64.tar.gz  ##??????????
3 [root@Mysql_server tools]# tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz   ##???Mysql??
4 [root@Mysql_server tools]# useradd -s /sbin/nologin -M mysql  ##????mysql???
5 [root@Mysql_server tools]# id mysql
6 uid=501(mysql) gid=501(mysql) groups=501(mysql)
7 [root@Mysql_server ~]# mkdir /application/
8 [root@Mysql_server home]# mv /home/zhurui/tools/mysql-5.5.32-linux2.6-x86_64 /application/mysql-5.5.32
9 [root@Mysql_server tools]# ll /application/
10 total 4
11 drwxr-xr-x. 13 root root 4096 Dec 13 14:31 mysql-5.5.32
12 [root@Mysql_server tools]# ln -s /application/mysql-5.5.32/ /application/mysql  ##??????????
13 [root@Mysql_server tools]# ll /application/
14 total 4
15 lrwxrwxrwx.  1 root root   26 Dec 13 14:39 mysql -> /application/mysql-5.5.32/
16 drwxr-xr-x. 13 root root 4096 Dec 13 14:31 mysql-5.5.32
17 [root@Mysql_server tools]# ll /application/mysql/
18 total 76
19 drwxr-xr-x.  2 root root   4096 Dec 13 14:31 bin
20 -rw-r--r--.  1 7161 wheel 17987 Jun 19  2013 COPYING
21 drwxr-xr-x.  3 root root   4096 Dec 13 14:31 data
22 drwxr-xr-x.  2 root root   4096 Dec 13 14:30 docs
23 drwxr-xr-x.  3 root root   4096 Dec 13 14:31 include
24 -rw-r--r--.  1 7161 wheel  7470 Jun 19  2013 INSTALL-BINARY
25 drwxr-xr-x.  3 root root   4096 Dec 13 14:31 lib
26 drwxr-xr-x.  4 root root   4096 Dec 13 14:31 man
27 drwxr-xr-x. 10 root root   4096 Dec 13 14:31 mysql-test
28 -rw-r--r--.  1 7161 wheel  2496 Jun 19  2013 README
29 drwxr-xr-x.  2 root root   4096 Dec 13 14:31 scripts
30 drwxr-xr-x. 27 root root   4096 Dec 13 14:31 share
31 drwxr-xr-x.  4 root root   4096 Dec 13 14:31 sql-bench
32 drwxr-xr-x.  3 root root   4096 Dec 13 14:31 support-files
????1.1.2 ??????????
1 [root@Mysql_server tools]# /application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql  ##??????????
2 Installing MySQL system tables...
3 OK
4 Filling help tables...
5 OK
6 [root@Mysql_server tools]# ll /application/mysql/data/  ##??????????
7 total 12
8 drwx------. 2 mysql root  4096 Dec 13 14:45 mysql
9 drwx------. 2 mysql mysql 4096 Dec 13 14:45 performance_schema
10 drwxr-xr-x. 2 mysql root  4096 Dec 13 14:31 test
????1.1.3 ???Mysql????????????
????1 [root@Mysql_server ~]# chown -R mysql.mysql /application/mysql/
????2 [root@Mysql_server ~]# ll /application/mysql
????3 lrwxrwxrwx. 1 mysql mysql 26 Dec 13 14:39 /application/mysql -> /application/mysql-5.5.32/
????1.1.4 ????Mysql???????
????1 [root@Mysql_server tools]# cp /application/mysql/support-files/my-small.cnf /etc/my.cnf
????1.1.5 ???????Mysql
????1 [root@Mysql_server tools]# sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /application/mysql/support-files/mysql.server
????2 [root@Mysql_server tools]# cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld  ##???????????????????init.d????
????3 [root@Mysql_server tools]# chmod +x /etc/init.d/mysqld
????1.1.6 ???Mysql
1 [root@Mysql_server tools]# lsof -i :3306  ##???Mysql?????????
2 [root@Mysql_server tools]#
3 [root@Mysql_server tools]# /etc/init.d/mysqld start  ##???Mysql????
4 Starting MySQL.... SUCCESS!
5 [root@Mysql_server tools]# lsof -i :3306
6 COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
7 mysqld  2235 mysql   10u  IPv4  22761      0t0  TCP *:mysql (LISTEN)
8 [root@Mysql_server tools]#
????1.1.7 ???????????
????????1??
????1 [root@Mysql_server tools]# cp /application/mysql/bin/* /usr/local/sbin/ ##????1
????????2??
????1 [root@Mysql_server tools]# tail -1 /etc/profile
????2 PATH="/application/mysql/bin:$PATH"   ##β???????????
????3 [root@Mysql_server tools]# source /etc/profile    ##?????????Ч
????1.1.8 ???ü?????????
????1 [root@Mysql_server tools]# mysqladmin -uroot password 123456
????2 [root@Mysql_server tools]# mysqladmin -uroot -p123456 password zhurui