对于一般用户而言喜欢编译安装或者yum安装,在本人工作中,一般都是用二进制快速安装,这里讲安装步骤记录如下:
1.下载二进制文件到目录/home/www/tools下
1
2
3
4
|
[root@Fabric-64 tools]
# ll
total 102
-rw-r--r-- 1 root root 186722932 Apr 22 2015 mysql-5.5.32-linux2.6-x86_64.
tar
.gz
[root@Fabric-64 tools]
#
|
2.创建/application目录和及其下面子目录/application/mysql、/application/mysql/data
1
2
3
4
5
6
7
|
[root@Fabric-64 tools]
# mkdir -p /application/mysql/data
[root@Fabric-64 tools]
# tree /application/
/application/
└── mysql
└── data
2 directories, 0 files
[root@Fabric-64 tools]
#
|
3.安装mysql
1
2
3
4
|
ls
mysql-5.5.32-linux2.6-x86_64.
tar
.gz
tar
xf mysql-5.5.32-linux2.6-x86_64.
tar
.gz
mv
mysql-5.5.32-linux2.6-x86_64
/application/mysql-5
.5.32
ln
-s
/application/mysql-5
.5.32
/application/mysql
|
##########相当于编译步骤的make install完成#############
4.创建用户和目录
1
2
|
useradd
mysql -s
/sbin/nologin
-M
chown
-R mysql.mysql
/application/mysql/data/
|
5.初始化数据库
1
2
3
4
5
6
7
8
9
10
11
|
cd
/application/mysql
.
/scripts/mysql_install_db
--user=mysql --basedir=
/application/mysql
--datadir=
/application/mysql/data/
\
cp
support-files
/my-small
.cnf
/etc/my
.cnf
cp
support-files
/mysql
.server
/etc/init
.d
/mysqld
chmod
+x
/etc/init
.d
/mysqld
sed
-i
's#/usr/local/mysql#/application/mysql#g'
/application/mysql/bin/mysqld_safe
/etc/init
.d
/mysqld
/etc/init
.d
/mysqld
start
netstat
-lntup|
grep
mysql
cp
-a
/application/mysql/bin/
*
/usr/local/sbin/
mysqladmin password Tnt123
mysql -uroot -pTnt123
|
本文转自027ryan 51CTO博客,原文链接:http://blog.51cto.com/ucode/1719529
,如需转载请自行联系原作者