In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Background
* MySQL is a relational database management system developed by the Swedish company MySQL AB and currently under the umbrella of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is the best RDBMS (relational database management system) application software.
* MySQL is a relational database management system in which relational databases store data in different tables instead of all data in one large warehouse, which increases speed and flexibility.
* the SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts the dual licensing policy, which is divided into community version and commercial version. Because of its small size, high speed and low total cost of ownership, especially open source, the development of small and medium-sized websites generally choose MySQL as the website database.
two。 The reason for choosing
* support multiple platforms [AIX, FreeBSD, HP-UX, Linux, Mac OS, OpenBSD, Solaris, Windows.]
* support and provide multilingual API
* Open source, using the GPL protocol, you can modify the source code to develop your own MySQL system
* support standard SQL statements
* multiple storage engines are supported
* widely used [all global top20 websites apply MySQL except Microsoft's Live and Bing]
3. MySQL installation mode
* two-system package installation
* Source code compilation and installation
* platform installation package, such as rpm package [centos,redhat] or deb [debian,ubuntu] package
4. Environment [turn off selinux]
[root@MySQL ~] # cat / etc/redhat-release CentOS release 6.9 (Final) [root@MySQL] # uname-r2.6.32-642.3.1.el6.x86_64 [root@MySQL ~] # hostnameMySQL [root@MySQL ~] # getenforce Disabled
5. Installation [MySQL 5.7s are installed in the same way as MySQL 5.5pm 5.6]
* download MySQL5.7 binary package [recommended for official download from MySQL]
[root@MySQL ~] # wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
* decompress MySQL 5.7binary package
[root@MySQL ~] # tar zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
* Mobile MySQL 5.7binary package
[root@MySQL ~] # mv mysql-5.7.18-linux-glibc2.5-x86_64 / usr/local/
* create soft links
[root@MySQL] # ln-s / usr/local/mysql-5.7.18-linux-glibc2.5-x86_64 / usr/local/mysql
* create mysql users
[root@MySQL] # useradd-r-s / sbin/nologin mysql
* create a directory for storing MySQL data
[root@MySQL ~] # mkdir-vp / data/mysql_datamkdir: created directory `/ data'mkdir: created directory` / data/mysql_data'
* create a mysql-files directory in the MySQL binary package directory [MySQL data import / export data dedicated directory]
[root@MySQL ~] # mkdir-v / usr/local/mysql/mysql-filesmkdir: created directory `/ usr/local/mysql/mysql-files'
* modify the users and groups of the MySQL binary package directory
[root@MySQL] # chown root.mysql-R / usr/local/mysql-5.7.18-linux-glibc2.5-x86_64
* modify the users and groups of the MySQL data directory and the data import / export directory
[root@MySQL ~] # chown mysql.mysql / usr/local/mysql/mysql-files / data/mysql_data
* renaming does not use the system's own MySQL configuration file / etc/my.cnf [debian system in / etc/mysql/my.cnf]
[root@MySQL ~] # mv / etc/my.cnf {, .old}
* initialization [random password will be included in the output log after initialization is completed]
* version less than MySQL 5.7.6 [
< 5.7.6 ] [root@MySQL ~]# /usr/local/mysql/bin/mysql_install_db \--user=mysql \--basedir=/usr/local/mysql \--datadir=/data/mysql_data * 版本大于或等于MySQL 5.7.6 [ >= 5.7.6]
* initialize and specify the basic directory and data storage directory
[root@MySQL] # / usr/local/mysql/bin/mysqld-- initialize\-- user=mysql\-- basedir=/usr/local/mysql\-- datadir=/data/mysql_data 2017-06-23T20:13:52.827475Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-- explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-23T20:13:57.684349Z 0 [Warning] InnoDB: New log files created, LSN=457902017-06-23T20:13:58.435803Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2017-06-23T20:13:58.525266Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7d8f2b79-5850-11e7-9dab-000c29f0b169.2017-06-23T20:13:58.538505Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2017-06-23T20:13:58.543606Z 1 [Note] A temporary password is generated for root@localhost: Z91g%.6d&fay
* Open SSL connection
[root@MySQL] # / usr/local/mysql/bin/mysql_ssl_rsa_setup-- user=mysql\-- user=mysql\-- basedir=/usr/local/mysql\
6. Create a startup script
* copy the startup script to the service service management directory [/ etc/init.d]
[root@MySQL ~] # cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysqld
* modify mysql startup script [/ et/init.d/mysqld]
Basedir= = > basedir=/usr/local/mysqldatadir= > datadir=/data/mysql_data
* add script execution permissions
[root@MySQL ~] # chmod + x / etc/init.d/mysqld
* add to service service management
[root@MySQL] # chkconfig-- add mysqld
7. Service startup test
* start the MySQL service
[root@MySQL ~] # / etc/init.d/mysqld startStarting MySQL.Logging to'/ data/mysql_data/MySQL.err'... SUCCESS!
* check whether the service starts and listens to the port [default 3306]
[root@MySQL ~] # netstat-lntp | grep 3306tcp 0 0: 3306: * LISTEN 20896/mysqld
8. Service startup test
* connect through the built-in mysql client [use the random password output during initialization]
[root@MySQL] # / usr/local/mysql/bin/mysql-p'Z91g%.6d&fay'mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 3Server version: 5.7.18Copyright (c) 2000, 2017, 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.mysql >
* change the password
Mysql > set password = '123456 inquiry OK, 0 rows affected (0.00 sec)
* reuse password connection
Mysql > quitBye [root@MySQL ~] # / usr/local/mysql/bin/mysql-p'123456'mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 4Server version: 5.7.18 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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.mysql >
9. Summary
In order to demand-driven technology, there is no difference in technology itself, only in business.
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.