In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
MySQL 5.7.22 installation
Download address of mysql5.7.22 installation package:
Https://dev.mysql.com/downloads/mysql/5.7.html#downloads
Here according to their own actual environment to choose, this article chooses the general tar package to install.
Pre-installation environment prepares SElinux to shut down
Vi / etc/selinux/config
Confirm SELINUX=disabled, if not, change this parameter to disabled and save it and restart the operating system
Turn off the operating system firewall to query the status of the current system firewall
[root@linux6 ios] # service iptables status
Turn off the firewall service
[root@linux6 ios] # service iptables stop
Configure the firewall to turn off permanently
[root@linux6 ios] # chkconfig-- level 2345 iptables off
Or
[root@linux6 ios] # chkconfig iptables off
Modify the scheduling of the system to deadline to query the scheduling mode of the current system
[root@linux6 ios] # cat / sys/block/sda/queue/scheduler
The default is cfq mode, where the sda of the command is the disk letter of the current system, and all disks are queried if there are multiple disks.
Modify the I etc/grub.conf O schedule to deadline mode, modify / etc/grub.conf (or / boot/grub/menu.lst) to add elevator=deadline, and then restart the operating system
Before rhgb quiet, add elevator=deadline
Kernel / vmlinuz-2.6.32-642.el6.x86_64 ro root=UUID=10c712fb-a82a-4afd-9e7a-1fa2475e8091 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM elevator=deadline rhgb quiet
Set the configuration of the swap partition
The size of the value of swappiness has a lot to do with how swap partitions are used. Swappiness=0 means to maximize the use of physical memory, followed by swap space. Swappiness=100 means to actively use swap partitions and move the data in memory to swap space in time.
Recommendation: if the memory is large enough and only the mysql database is running on the server, you can set this value to be too small.
The default swappiness is 60
[root@linux6 ~] # cat / proc/sys/vm/swappiness
sixty
If you want to modify it, edit / etc/sysctl.conf and add vm.swappiness = 60.
The modification is complete, execute
[root@linux6] # sysctl-p
Make the parameter effective
The choice of file system
Xfs file system is recommended
Modify the limitations of the operating system
Modify limit.conf add configuration
[root@linux6 ios] # cat / etc/security/limits.conf
Numa shuts down
It is recommended that you use parameters to close before mysql starts.
For example
Numactl-interleave=all / usr/local/mysql/bin/mysqld_safe-defaults-file=/etc/my.cnf &
For numa, you can refer to:
Http://cenalulu.github.io/linux/numa/
Start installation to create Mysql users and groups
[root@linux6 Mysql5.7.22] # groupadd mysql
[root@linux6 Mysql5.7.22] # useradd-g mysql mysql
The mysql installation package is placed under / usr/local and unzipped
[root@linux6 ~] # cd / usr/local/
[root@linux6 local] # tar-zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
Give the decompressed mysql software package to make a soft connection
[root@linux6 local] # ln-s mysql-5.7.22-linux-glibc2.12-x86_64 mysql
Authorize the mysql directory
[root@linux6 local] # chown mysql.mysql-R mysql
Create a data directory for the mysql database (datadir)
[root@linux6 Mysql5.7.22] # mkdir-p / data/mysql
[root@linux6 Mysql5.7.22] #
And give the authority to mysql
[root@linux6 Mysql5.7.22] # chown-R mysql.mysql / data/mysql
[root@linux6 Mysql5.7.22] #
Configure the my.cnf file
The relevant configuration can be made according to the actual environment here.
Initialize the database
[root@linux6 etc] # cd / usr/local/mysql/bin/
[root@linux6 bin] #
[root@linux6 bin] # / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql-- user=mysql-- initialize
The parameter initialize is used here, which means that a temporary database initial password will be generated and recorded in the log-error (error log).
Here are two crossbars-initialize, not one.
Start the database
[root@linux6 bin] # pwd
/ usr/local/mysql/bin
[root@linux6 bin] # numactl-interleave=all. / mysqld_safe-defaults-file=/etc/my.cnf &
Start mysql with numa disabled
View the status of mysql
Get the initial database password
After the database starts successfully, the initialization password for entering the database will be in / data/mysql/error.log
[root@linux6 mysql] # cat / data/mysql/error.log | grep password
2018-06-12T07:43:15.875584Z 1 [Note] A temporary password is generated for root@localhost:!
Modify database root password
Enter the database to change the password according to the initialization password obtained in the above steps
[root@linux6 bin] #. / mysql-uroot-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 4
Server version: 5.7.22-log
Copyright (c) 2000, 2018, 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.
Root@db 15:53: [(none)] > set password = 'mysql'
Query OK, 0 rows affected (0.00 sec)
Root@db 15:53: [(none)] > flush privileges
Query OK, 0 rows affected (0.01 sec)
Root@db 15:53: [(none)] >
Unable to start mysql database after installation error set initialization
Query the error.log log and find the following error:
Query data file directory / data/mysql
It is true that no data file was generated for the mysql instance.
The positioning problem should be that there is a problem with initialization, and the initialization command is queried later:
. / mysqld-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/data/mysql-- user=mysql-initialize
There is only a crossbar in front of the initialize, which leads to this problem.
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.