In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you the general binary installation method of MySQL 5.7.21 based on OEL6.9 platform. I hope that the general binary installation method of MySQL 5.7.21 based on OEL6.9 platform can bring you practical use, which is also the main purpose of my editing this article. All right, don't talk too much nonsense, let's just read the following.
Prerequisite preparation (turn off firewall, selinux, install libaio) shell > chkconfig-- level 2345 iptables offshell > service iptables stopshell > vi / etc/selinux/configSELINUX=disabled
Shell > yum install libaio
1. Configure users to belong to groups (MySQL users do not need to log in to the operating system)
Shell > groupadd mysql
Shell > useradd-r-g mysql-s / bin/false mysql
two。 Decompress binary software
Shell > cd / usr/local
Shell > mv ~ / mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz. /
Shell > tar zxvf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
Or
Shell > gunzip
< mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz | tar xvf - shell>Mv mysql-5.7.21-linux-glibc2.12-x86_64 mysql-5.7.21
3. Modify software permissions to create links
Shell > chmod-R 750. / mysql-5.7.21
Shell > chown-R mysql:mysql. / mysql-5.7.21
Shell > ln-s / usr/local/mysql-5.7.21 mysql
4. Create a MySQL data directory (touch log file in advance, otherwise an error will be reported at startup)
Shell > mkdir-p / mysql/ {data,log,binlog}
Shell > chown-R mysql:mysql / mysql/
Shell > touch / mysql/log/mysqld.log
Shell > chown mysql:mysql / mysql/log/mysqld.log
5. Edit database CVM parameters (specify the data initialization directory, or you can specify the initialization directory through the command line)
Shell > vi / etc/my.cnf
[mysqld]
Datadir=/mysql/data
Socket=/mysql/log/mysql.sock
[mysqld_safe]
Log_error=/mysql/log/mysqld.log
Pid_file=/mysql/log/mysqld.pid
6. Initialize the database
Shell > cd mysql
Shell > bin/mysqld-initialize-user=mysql (m3gfb bin/mysql_ssl_rsa_setup
Shell > bin/mysqld_safe-- user=mysql &
7. Modify the default root password
[root@crmdb1 mysql] # mysql-u root-p-S / mysql/log/mysql.sock
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' oracle'
Mysql > FLUSH PRIVILEGES
8. Close the database `[root@crmdb1 mysql] # bin/mysqladmin-u root-p-S / mysql/log/mysql.sock shutdown`9. Modify environment variabl
Shell > vi ~ / .bash_profile
Export PATH=/usr/local/mysql/bin:$PATH
Export MYSQL_PS1= "(\ u@\ h) [\ d] >"
[root@crmdb1 mysql] #. ~ / .bash_profile
10. Configure the MySQL service
Shell > cp support-files/mysql.server / etc/init.d/mysql
Shell > chkconfig-- add mysql
Shell > chkconfig-- level 2345 mysql on
11. Edit database client parameters
[client]
Host=localhost
User=root
Password=oracle
Socket=/mysql/log/mysql.sock
twelve。 Start the MySQL service `shell > service mysql start`13. Login database verification
Shell > mysql
(root@localhost) [(none)] > show databases
Error resolution: 1.
2018-03-15T13:38:06.902460Z 0 [ERROR] SSL error: Unable to get private key from 'server-key.pem'
2018-03-15T13:38:06.902470Z 0 [Warning] Failed to set up SSL because of the following SSL library error: Unable to get private key
The mysql user does not have permission to access the 'server-key.pem' file. The error is resolved after modifying the permission:
[root@crmdb1 security] # cd / mysql/data/
[root@crmdb1 data] # ls-la server-key.pem
-rw- 1 root root 1679 Mar 15 21:24 server-key.pem
[root@crmdb1 data] # chmod 644 server-key.pem
[root@crmdb1 data] # service mysql restart
2018-03-15T14:29:38.605619Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
Null
two。
2018-03-15T13:38:06.767757Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_time
Stamp server option (see documentation for more details).
Resolve the alarm by setting parameters:
Explicit_defaults_for_timestamp=1
Note
Explicit_defaults_for_timestamp is itself deprecated because its only purpose is to permit control over deprecated TIMESTAMP behaviors that are to be removed in a future MySQL release. When removal of those behaviors occurs, explicit_defaults_for_timestamp will have no purpose and will be removed as well.
For the above about MySQL 5.7.21 general binary installation method based on OEL6.9 platform, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
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.