Mysql5.6 installation process

 

 

1, yum -y install lrzsz --- install the tool used to upload files, command line input rz can upload files directly in local

2, after the upload is complete, unzip the file, unzip the file in / usr / local / under, and the establishment of flexible connections

  Objective To establish a flexible connection is: In order to facilitate version control

  

    

 

 

 3, the next step of the operation of the installation according to mysql

/usr/local/mysql/INSTALL-BINARY
The following step is to install the file
cat /usr/local/mysql/INSTALL-BINARY
.....
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

.....

4, after increasing msyql groups, users, establishing a soft connection, the mysql database directory file owner, is a modifying group, step 3 is completed by

  After modifications, should be in addition to other data is mysql mysql full root mysql

[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# ll
Total amount 156 
drwxr -XR-X.   2 the root MySQL    4096 2 dated   15  13 is : 49 bin
 -rw-R & lt - r--.   . 1 the root MySQL   17987 . 9 dated   18 is  , 2015 the COPYING
Drwxr . -Xr-X   5 Mysql Mysql     192 2 May   15  13 : 57 Data
drwxr-xr-x.  2 root  mysql     55 2月  15 13:49 docs
drwxr-xr-x.  3 root  mysql   4096 2月  15 13:49 include
-rw-r--r--.  1 root  mysql 105656 9月  18 2015 INSTALL-BINARY
drwxr-xr-x.  3 root  mysql   4096 2月  15 13:48 lib
drwxr-xr-x.  4 root  mysql     30 2月  15 13:49 man
-rw-r--r--.  1 root  root     943 2月  15 13:51 my.cnf
drwxr-xr-x. 10 root  mysql   4096 2月  15 13:49 mysql-test
-rw-r--r--.  1 root  mysql   2496 9月  18 2015 README
drwxr-xr-x.  2 root  mysql     30 2月  15 13:48 scripts
drwxr-xr-x. 28 root  mysql   4096 2月  15 13:48 share
drwxr-xr-x.  4 root  mysql   4096 2月  15 13:49 sql-bench
drwxr -XR-the X-.   2 root MySQL     136 2 Yue   15  13 : 48 Support-Files 
because Linux comes with Mariadb, there /etc/my.cnf file, but the configuration is wrong, may cause initialization problem, we first conduct as follows:
Music Videos /etc/my.cnf /etc/my.cnf.old

5, followed by database initialization, but at initialization time reported a mistake, one less dependent packages to address the following:

[root@localhost mysql]# scripts/mysql_install_db --user=mysql
FATAL ERROR: please install the following Perl modules before executing scripts/mysql_install_db:
Data::Dumper
[root@localhost mysql]# yum -y install autoconf

6. After installing dependencies, initialized, the initialization process there should be no error message, check whether the initialization, you can check if mysql data directory has the appropriate data file generation

[root@localhost mysql]# ll data
Total amount 110600 
-rw -----RW. . 1 MySQL MySQL 12,582,912 2 dated   15  13 is : 51 is ibdata1
 -rw -----RW. . 1 MySQL MySQL 50331648 2 dated   15  13 is : 51 is ib_logfile0
 -rw-RW --- -. . 1 MySQL MySQL 50331648 2 dated   15  13 is : 51 is ib_logfile1
Drwx . ------ 2 Mysql Mysql      4096 2 May   15  13 : 51 Mysql
drwx------. 2 mysql mysql     4096 2月  15 13:51 performance_schema
Drwxr . -Xr-X 2 Mysql Mysql        20 2 May   15  13 : 48 Test

 

7, after initialization is complete, start the database

[root@localhost mysql]# ./bin/mysqld_safe --user=mysql &
[1] 9283
[root@localhost mysql]# 200215 13:55:05 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
200215 13:55:05 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
[root@localhost mysql]#
[root@localhost mysql]#
[root@localhost mysql]#
[root@localhost mysql]# ps -ef | grep mysql
root       9216   9107  0 13:50 pts/2    00:00:00 less /usr/local/mysql/INSTALL-BINARY
root       9283   8618  0 13:55 pts/1    00:00:00 /bin/sh ./bin/mysqld_safe --user=mysql
mysql      9373   9283  1 13:55 pts/1    00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid
root       9396   8618  0 13:55 pts/1    00:00:00 grep --color=auto mysql
By mysql_safe start the process, mysql_safe is a daemon, after mysql process is Kill off, it will restart Mysql process, as follows:
[root @ localhost mysql] # the kill -9 9373
[root @ localhost mysql] # ./bin/ the mysqld_safe: line 166: 9373 has been killed nohup / usr / local / mysql / bin / mysqld --basedir = / usr / local / mysql --datadir = / usr / local / mysql / data --plugin-dir = / usr / local / mysql / lib / plugin --user = mysql --log-error = / usr / local / mysql / data / localhost.localdomain.err --pid-file = / usr / local / mysql / data / localhost. localdomain.pid </ dev / null /usr/local/mysql/data/localhost.localdomain.err >> 2> &. 1
200215 13:57:52 Processes of the mysqld_safe Number The running now: 0
200215 13:57:52 mysqld the mysqld_safe RESTARTED

 

Guess you like

Origin www.cnblogs.com/shy-1208/p/12312059.html