In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The whole process of 5.7.23 installation in production environment
Execute the initialization.sh optimization script first. For more information, please see Linux.
Before installing mysql, you need to check to see if the system comes with mysql.
We need to delete the system. It comes with mysql lib.
Let's put mysql under / opt first.
Upload the one that is consistent with the online version
[root@prd3-mysql01-180 opt] # cat / etc/redhat-release CentOS release 6. 5 (Final) [root@prd3-mysql-0-36 opt] # lltotal 629320 initialization.sh-rw-r--r---1 root root 7214 Mar 27 17:37 initialization.sh-rw-r--r-- 1 root root 644399365 Oct 13 2018 mysql-5.7.23-linux-glibc2.12-x86_64.tar.gzdrwxr-xr-x. 2 root root 4096 Nov 22 2013 rhdrwxr-xr-x 2 root root 4096 Apr 23 16:34 scripts
Step 1: delete the lib that comes with the expired system
[root@prd3-mysql-0-36 opt] # rpm-qa | grep mysqlmysql-libs-5.1.71-1.el6.x86_64 [root@prd3-mysql-0-36 opt] # find /-name "mysql" / usr/share/mysql/usr/lib64/mysql [root@prd3-mysql-0-36 opt] # rpm-e-nodeps mysql-libs-5.1.71-1.el6.x86_64 [root@prd3-mysql-0-36 opt] # rpm-qa | grep mysql [root@prd3-mysql-0-36 opt] # find /-name "mysql" supplementary installation related dependencies / / to do Prevent subsequent errors [root@ct6 ~] # yum-y install perl-Module-Install.noarch [root@ct6 ~] # rpm-qa | grep 'perl-Module-Install' perl-Module-Install-0.91-4.el6.noarch
The second step is to create the user of mysql
[root@prd3-mysql-0-36 opt] # groupadd mysql [root@prd3-mysql-0-36 opt] # useradd-r-g mysql- s / bin/false mysql
The third step is to create a data directory for mysql
[root@prd3-mysql-0-36 opt] # mkdir-p / ivargo/data/mysql
Step 3: extract the mysql installation package to / usr/local
[root@prd3-mysql-0-36 opt] # tar-zxvf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz-C / usr/local/. [root@prd3-mysql-0-36 opt] # cd / usr/local/ [root@prd3-mysql-0-36 local] # lltotal 44drwxr-xr-x. 2 root root 4096 Sep 23 2011 bindrwxr-xr-x. 2 root root 4096 Sep 23 2011 etcdrwxr-xr-x. 2 root root 4096 Sep 23 2011 gamesdrwxr-xr-x. 2 root root 4096 Sep 23 2011 includedrwxr-xr-x. 2 root root 4096 Sep 23 2011 libdrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexecdrwxr-xr-x 9 root root 4096 Apr 23 17:12 mysql-5.7.23-linux-glibc2.12-x86_64drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbindrwxr-xr-x. 5 root root 4096 Apr 16 2018 sharedrwxr-xr-x. 2 root root 4096 Sep 23 2011 src come here in two ways, one is direct mv and the other is ln-s soft connection. Here we implement the same as in production, using mv step 4: create / usr/local/mysql [root@prd3-mysql-0-36 local] # mkdir mysql [root@prd3-mysql-0-36 local] # lltotal 48drwxr-xr-x. 2 root root 4096 Sep 23 2011 bindrwxr-xr-x. 2 root root 4096 Sep 23 2011 etcdrwxr-xr-x. 2 root root 4096 Sep 23 2011 gamesdrwxr-xr-x. 2 root root 4096 Sep 23 2011 includedrwxr-xr-x. 2 root root 4096 Sep 23 2011 libdrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexecdrwxr-xr-x 2 root root 4096 Apr 23 17:20 mysqldrwxr-xr-x 9 root root 4096 Apr 23 17:12 mysql-5.7.23-linux-glibc2.12-x86_64drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbindrwxr-xr-x. 5 root root 4096 Apr 16 2018 sharedrwxr-xr-x. 2 root root 4096 Sep 23 2011 src [root@prd3-mysql-0-36 local] # mv / usr/local/mysql-5.7.23-linux-glibc2.12-x86_64/* / usr/local/mysql [root@prd3-mysql-0-36 local] # rm-rf mysql-5.7.23-linux-glibc2.12-x86_64/ [root @ prd3-mysql-0-36 local] # lltotal 44drwxr-xr-x. 2 root root 4096 Sep 23 2011 bindrwxr-xr-x. 2 root root 4096 Sep 23 2011 etcdrwxr-xr-x. 2 root root 4096 Sep 23 2011 gamesdrwxr-xr-x. 2 root root 4096 Sep 23 2011 includedrwxr-xr-x. 2 root root 4096 Sep 23 2011 libdrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexecdrwxr-xr-x 9 root root 4096 Apr 23 17:21 mysqldrwxr-xr-x. 2 root root 4096 Sep 23 2011 sbindrwxr-xr-x. 5 root root 4096 Apr 16 2018 sharedrwxr-xr-x. 2 root root 4096 Sep 23 2011 src step 5: set the permissions for / usr/local/mysql [root@prd3-mysql-0-36 local] # pwd/usr/local [root@prd3-mysql-0-36 local] # chown-R mysql:mysql mysql step 6: modify the mysql configuration file [root@prd3-mysql-0-36 local] # pwd/usr/local [root@prd3-mysql-0-36 local] # lltotal 44drwxr-xr-x. 2 root root 4096 Sep 23 2011 bindrwxr-xr-x. 2 root root 4096 Sep 23 2011 etcdrwxr-xr-x. 2 root root 4096 Sep 23 2011 gamesdrwxr-xr-x. 2 root root 4096 Sep 23 2011 includedrwxr-xr-x. 2 root root 4096 Sep 23 2011 libdrwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexecdrwxr-xr-x 9 mysql mysql 4096 Apr 23 17:21 mysqldrwxr-xr-x. 2 root root 4096 Sep 23 2011 sbindrwxr-xr-x. 5 root root 4096 Apr 16 2018 sharedrwxr-xr-x. 2 root root 4096 Sep 23 2011 src [root@prd3-mysql-0-36 local] # cd mysql/ [root@prd3-mysql-0-36 mysql] # lltotal 52drwxr-xr-x 2 mysql mysql 4096 Apr 23 17:12 bin-rw-r--r-- 1 mysql mysql 17987 Jun 8 2018 COPYINGdrwxr-xr-x 2 mysql mysql 4096 Apr 23 17:13 docsdrwxr-xr-x 3 mysql mysql 4096 Apr 23 17:11 includedrwxr-xr-x 5 mysql mysql 4096 Apr 23 17:12 libdrwxr-xr-x 4 mysql mysql 4096 Apr 23 17:12 man-rw-r--r-- 1 mysql mysql 2478 Jun 8 2018 READMEdrwxr-xr-x 28 mysql mysql 4096 Apr 23 17:12 sharedrwxr-xr-x 2 mysql mysql 4096 Apr 23 17:12 support-files [root@prd3-mysql-0-36 mysql] # cd support-files/ [root@prd3-mysql-0-36 support-files] # lltotal 24 Muhami RUV-1 mysql mysql 773 Jun 8 2018 magic-rwxr-xr-x 1 mysql mysql 1061 Jun 8 2018 mysqld_multi.server-rwxr-xr-x 1 mysql mysql 894 Jun 8 2018 mysql-log-rotate-rwxr-xr-x 1 mysql mysql 10576 Jun 8 2018 mysql.server [root@prd3-mysql-0-36 support-files] # cp mysql.server / etc/init.d/mysql then modify the parameters of / etc/init.d/mysql Vim / etc/init.d/mysql modifies basedir=/usr/local/mysqldatadir=/ivargo/data/mysql settings configuration file launched by mysql my.cnf settings configuration file / etc/my.cnf [root@prd3-mysql-0-36 support-files] # find /-name "my.cnf" [root@prd3-mysql-0-36 opt] # mv my.cnf / etc/ [root@prd3-mysql-0-36 opt] # ls-l / etc/my.cnf-rw- RMurray root root-1 root root 1649 Oct 11 2018 / etc/my.cnf step 7: initialize MySQL [root @ prd3-mysql-0-36 bin] # pwd/usr/local/mysql/bin initialization command. / mysqld-- defaults-file=/etc/my.cnf-- initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/ivargo/data/mysql [root@prd3-mysql-0-36 bin] #. / mysqld-- defaults-file=/etc/my.cnf -initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/ivargo/data/mysql. Step 8: start mysql and set the boot chkconfig mysql on [root@prd3-mysql-0-36 bin] # service mysql startStarting MySQL.. SUCCESS! [root@prd3-mysql-0-36 bin] # netstat-lntupActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 of the root@prd3-mysql-0 * LISTEN 1531/sshd tcp 0 0 127.0. .0.1 LISTEN 1607/master tcp 25 0.0.0.0 LISTEN 1607/master tcp 0: 22: * LISTEN 1531/sshd tcp 0 0:: 1:25:: * LISTEN 1607/master tcp 0 0: 3306: * LISTEN 4567/mysqld
Step 9: reset the mysql password
[root@prd3-mysql-0-36 bin] #. / mysql- uroot-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.7.23-logCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.@ (none) > SET PASSWORD FOR 'root'@'localhost'=PASSWORD (' xxx'); Query OK, 0 rows affected, 1 warning (0.01 sec) @ (none) > flush privileges;Query OK, 0 rows affected (0.00 sec)
Step 10: set the environment variable for mysql
I use my own method here.
Echo 'export PATH=/usr/local/mysql/bin:$PATH' > > / etc/profiletail-1 / etc/profilesource / etc/profile [root@prd3-mysql-0-36 opt] # which mysql/usr/local/mysql/bin/mysql
Step 11: optimize mysql
@ (none) > select user,host from mysql.user / / No pre-optimization +-+ | user | host | +-+-+ | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +-- -+ 3 rows in set (0.00 sec) [root@prd3-mysql-0-36 opt] # find /-name "mysql_secure_installation" / usr/local/mysql/bin/mysql_secure_installation after executing the initialization command @ (none) > show databases +-+ | Database | +-+ | information_schema | | mysql | | performance_schema | | sys | +-+ 4 rows in set (0.00 sec) @ (none) > select user,host from mysql.user +-+-+ | user | host | +-+-+ | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +-+-+ 3 rows in set (0.00 sec)
Need to give root% permission to production
GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' XXX' WITH GRANT OPTION; @ (none) > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' XXX' WITH GRANT OPTION; Query OK, 0 rows affected, 1 warning (0.01 sec) @ (none) > flush privileges;Query OK, 0 rows affected (0.00 sec) @ (none) > select user,host from mysql.user +-+-+ | user | host | +-+-+ | root |% | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | + -+ 4 rows in set (0.00 sec)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.