[iyunv@CentOS6 ~]# https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz
[iyunv@CentOS6 ~]# tar xf cmake-3.4.1.tar.gz
[iyunv@CentOS6 ~]# cd cmake-3.4.1
[iyunv@CentOS6 cmake-3.4.1]# ./bootstrap
[iyunv@CentOS6 cmake-3.4.1]# make
[iyunv@CentOS6 cmake-3.4.1]# make install
三、准备MySQL数据目录分区
[iyunv@CentOS6 ~]# fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +10G
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
六、MySQL的初始化工作
[iyunv@CentOS6 mysql-5.5.28]# cd /usr/local/mysql
[iyunv@CentOS6 mysql]# pwd
/usr/local/mysql
[iyunv@CentOS6 mysql]# ls
bin COPYING data docs include INSTALL-BINARY lib man mysql-test README scripts share sql-bench support-files
[iyunv@CentOS6 mysql]# chown -R .mysql .
[iyunv@CentOS6 mysql]# ll
total 76
drwxr-xr-x 2 root mysql 4096 Dec 19 21:09 bin
-rw-r--r-- 1 root mysql 17987 Aug 29 2012 COPYING
drwxr-xr-x 4 root mysql 4096 Dec 17 16:03 data
drwxr-xr-x 2 root mysql 4096 Dec 19 21:09 docs
drwxr-xr-x 3 root mysql 4096 Dec 19 21:09 include
-rw-r--r-- 1 root mysql 7604 Aug 29 2012 INSTALL-BINARY
drwxr-xr-x 3 root mysql 4096 Dec 19 21:09 lib
drwxr-xr-x 4 root mysql 4096 Dec 12 10:39 man
drwxr-xr-x 10 root mysql 4096 Dec 19 21:09 mysql-test
-rw-r--r-- 1 root mysql 2552 Aug 29 2012 README
drwxr-xr-x 2 root mysql 4096 Dec 19 21:09 scripts
drwxr-xr-x 27 root mysql 4096 Dec 17 13:50 share
drwxr-xr-x 4 root mysql 4096 Dec 19 21:09 sql-bench
drwxr-xr-x 2 root mysql 4096 Dec 19 21:09 support-files
[iyunv@CentOS6 mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data/
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
八、启动之后连接MySQL,删除匿名用户、设置root密码及远程访问授权
[iyunv@CentOS6 mysql]# service mysqld start
Starting MySQL... SUCCESS!
(1)、删除匿名用户
[iyunv@CentOS6 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.28-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.