MySQL Installation deployment
1. Installation Overview
MySQL has several different product lines, and each product line has a lot of different versions, here Select the most widely used community version of the MySQL5.5 series as the LNMP's composite environment database platform.
Enterprise Scenario MySQL installation Methods at a glance
serial number |
Mysql installation method |
|
1 |
Yum/rpm package installation |
|
2 |
binary installation |
decompression software simple configuration can be used without installation, faster, professional dba mysql-5.5.32-liux2.6-x86_64.tar.gz. |
3 |
source compilation installation |
features can be customized installation parameters, but the installation time is long, then example: An Fu Set Installation path , the software name is as follows: mysql-5.5.32.tar.gz |
4 |
SOURCE Software Combination |
make the source software into the required rpm, put it in the Yum Repository, and install it through yum . Combined with the advantages of 1 and 3 above , the installation is fast and can be arbitrarily customized, but it also requires a person with a deeper ability. |
Introduction to Installation Steps
1 Create a MySQL user's account
first log on to the Linux system as root , and then execute the following command to create the MySQL Group user group account:
[[email protected] ~]# Groupadd MySQL
Tips: The MySQL5.5 product line and the early MySQl5.0,5.1 series belong to different product lines, so the installation method differs.
Create a MySQL user
[[email protected] ~]# useradd-s/sbin/nologin-m MySQL
Create a directory that holds the installation package
[Email protected] ~]# mkdir/home/oldboy/tools/-P
[Email protected] ~]# cd/home/oldboy/tools/
[Email protected] ~]# mkdir/application/mysql/data/-P
[Email protected] tools]# wget-q http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.53-linux2.6-x86_64.tar.gz
2. Initialize
[[email protected] tools]# ls
mysql-5.5.53-linux2.6-x86_64.tar.gz nginx-1.6.3 nginx-1.6.3.tar.gz
[Email protected] tools]# Tar XF mysql-5.5.53-linux2.6-x86_64.tar.gz
[[email protected] tools]# ls
mysql-5.5.53-linux2.6-x86_64 XF mysql-5.5.53-linux2.6-x86_64.tar.gz nginx-1.6.3 nginx-1.6.3.tar.gz
[Email protected] tools]# mvmysql-5.5.53-linux2.6-x86_64/mysql-5.5.53
[[email protected] tools]# ls
mysql-5.5.53 mysql-5.5.53.tar.gz nginx-1.6.3 nginx-1.6.3.tar.gz
[Email protected] tools]# CD mysql-5.5.53
[Email protected] application]# ln-s/application/mysql-5.5.53//application/mysql
[Email protected] mysql]# ls-l/application/
Total Dosage 8
lrwxrwxrwx 1root Root 26 December 15:56 MySQL--/application/mysql-5.5.53/
Drwxr-xr-x root root 4096 December 15:46 mysql-5.5.53
lrwxrwxrwx 1root Root 25 December 10:47 Nginx--/application/nginx-1.6.3/
Drwxr-xr-x root root 4096 December 10:53 nginx-1.6.3
[Email protected] mysql]# \CPSUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF
[Email protected] mysql]#/scripts/mysql_install_db--user=mysql--basedir=/application/mysql--datadir=/ application/mysql/data/
Installing MySQL system tables ...
161211 16:10:40 [Note] ignoring--secure-file-privvalue as server is running with--bootstrap.
161211 16:10:40 [Note]/application/mysql/bin/mysqld (mysqld 5.5.53) starting as Process 11591 ...
Ok
Filling Help Tables ...
161211 16:10:40 [Note] ignoring--secure-file-privvalue as server is running with--bootstrap.
161211 16:10:40 [Note]/application/mysql/bin/mysqld (mysqld 5.5.53) starting as Process 11598 ...
Ok
Prompt two OK, the representative succeeds.
3. Configure and start the Mysql database
cd/application/mysql/
[Email protected] mysql]# ls-ld/tmp
DRWXRWXRWT. 3 root root 4096 December 17:32/tmp
[Email protected] mysql]# chmod-r 1777/tmp/
Set MySQL Startup script
[[email protected] MySQL] #cpsupport-files/mysql.server/etc/init.d/mysqld
[Email protected] mysql]# chmod +x/etc/init.d/mysqld
[Email protected] mysql]# sed-i ' s#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe/etc/ Init.d/mysqld
[[email protected] mysql]#/etc/init.d/mysqld start
Starting MySQL. success!
View MySQL Service has no boot
[[email protected] mysql]# lsof-i: 3306
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
Mysqld 11967mysql 10u IPv4 33961 0t0 TCP *:mysql (LISTEN)
Set The MySQL service is powered on from boot.
[Email protected] data]# chkconfig--add mysqld
[Email protected] data]# chkconfig mysqld on
[Email protected] data]# chkconfig--list |grep mysqld
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Configure mysql command global use path
[Email protected] data]# echo ' Exportpath=/application/mysql/bin:path ' >>/etc/profile
Export Path=/application/mysql/bin:path
[Email protected] data]# tail-1/etc/profile
Export Path=/application/mysql/bin:path
[Email protected] data]# Source/etc/profile
[Email protected] mysql]# echo $PATH
/application/mysql/bin:path
[[email protected] mysql]# MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.5.53 MySQL Community Server (GPL)
Copyright (c), Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of oraclecorporation and/or its
Affiliates. Other names trademarks of Theirrespective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clearthe the current input statement.
Mysql>
The problem cases that are not caused by the global path configuration are shown in the article:
http://oldboy.blog.51cto.com/2561410/1122867
Thank you mentor, old boy teacher's guidance, the above self-made summary.
This article is from the "Pcjazz" blog, make sure to keep this source http://520527.blog.51cto.com/510527/1881712
MySQL Installation deployment