In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 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 ~] # getenforce Disabled
5. Installation
* download MySQL5.6 binary package [recommended for official download from MySQL]
[root@MySQL ~] # wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
* decompress the MySQL binary package
[root@MySQL ~] # tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
* Mobile MySQL binary package
[root@MySQL ~] # mv mysql-5.6.36-linux-glibc2.5-x86_64 / usr/local/
* create soft links
[root@MySQL] # ln-s / usr/local/mysql-5.6.36-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 database files
[root@MySQL] # mkdir-p / data/mysql_data
* modify the users and user groups of the binary package directory and data directory
[root@MySQL] # chown mysql.mysql-R / usr/local/mysql-5.6.36-linux-glibc2.5-x86_64 / data/mysql_data
* copy the default configuration file to / etc/my.cnf
[root@MySQL ~] # cp / usr/local/mysql/support-files/my-default.cnf / etc/my.cnf
* MySQL initialization [create database related files] see that the two OK have no ERROR error message indicating that the initialization is successful
[root@MySQL] # / usr/local/mysql/scripts/mysql_install_db-user=mysql-basedir=/usr/local/mysql-datadir=/data/mysql_data WARNING: The host 'MySQL' could not be looked up with / usr/local/mysql/bin/resolveip.This probably means that your libc libraries are not 100% compatiblewith this binary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that hostname resolving will not work.This means that you should use IP addresses instead of hostnameswhen specifying MySQL privileges! Installing MySQL system tables...2017-06-24 03:57:47 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-- explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-24 03:57:47 0 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap.2017-06-24 03:57:47 0 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.6.36) starting as process 20685. 2017-06-24 03:57:47 20685 [Note] InnoDB: Using atomics to ref count buffer pool pages2017-06- 24 03:57:47 20685 [Note] InnoDB: The InnoDB memory heap is disabled2017-06-24 03:57:47 20685 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2017-06-24 03:57:47 20685 [Note] InnoDB: Memory barrier is not used2017-06-24 03:57:47 20685 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-24 03:57:47 20685 [Note] InnoDB: Using Linux native AIO2017-06-24 03:57:47 20685 [Note] InnoDB: Using CPU crc32 instructions2017-06-24 03:57:47 20685 [Note] InnoDB: Initializing buffer pool Size = 128.0M2017-06-24 03:57:47 20685 [Note] InnoDB: Completed initialization of buffer pool2017-06-24 03:57:47 20685 [Note] InnoDB: The first specified data file. / ibdata1 did not exist: a new database to be created2017-06-24 03:57:47 20685 [Note] InnoDB: Setting file. / ibdata1 size to 12 MB2017-06-24 03:57:47 20685 [Note] InnoDB: Database physically writes the file full: wait...2017-06-24 03:57:47 20685 [Note] InnoDB: Setting logfile. / ib_logfile101 size to 48 MB2017-06-24 03:57:49 20685 [Note] InnoDB: Setting logfile. / ib_logfile1 size to 48 MB2017-06-24 03:57:51 20685 [Note] InnoDB: Renaming logfile. / ib_logfile101 to. / ib_logfile02017-06-24 03:57:51 20685 [Warning] InnoDB: New log files created LSN=457812017-06-24 03:57:51 20685 [Note] InnoDB: Doublewrite buffer not found: creating new2017-06-24 03:57:51 20685 [Note] InnoDB: Doublewrite buffer created2017-06-24 03:57:51 20685 [Note] InnoDB: 128rollback segment (s) are active.2017-06-24 03:57:51 20685 [Warning] InnoDB: Creating foreign key constraint system tables.2017-06-24 03:57:51 20685 [Note] InnoDB: Foreign key constraint system tables created2017-06-24 03:57:51 20685 [Note] InnoDB: Creating tablespace and datafile system tables.2017-06-24 03:57:51 20685 [Note] InnoDB: Tablespace and datafile system tables created.2017-06-24 03:57:51 20685 [Note] InnoDB: Waiting for purge to start2017-06-24 03:57:52 20685 [Note] InnoDB: 5.6.36 started Log sequence number 02017-06-24 03:57:58 20685 [Note] Binlog end2017-06-24 03:57:58 20685 [Note] InnoDB: FTS optimize thread exiting.2017-06-24 03:57:58 20685 [Note] InnoDB: Starting shutdown...2017-06-24 03:58:00 20685 [Note] InnoDB: Shutdown completed; log sequence number 1625977OKFilling help tables...2017-06-24 03:58:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-- explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-24 03:58:00 0 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap.2017-06-24 03:58:00 0 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.6.36) starting as process 20731. 2017-06-24 03:58:00 20731 [Note] InnoDB: Using atomics to ref count buffer pool pages2017-06- 24 03:58:00 20731 [Note] InnoDB: The InnoDB memory heap is disabled2017-06-24 03:58:00 20731 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2017-06-24 03:58:00 20731 [Note] InnoDB: Memory barrier is not used2017-06-24 03:58:00 20731 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-24 03:58:00 20731 [Note] InnoDB: Using Linux native AIO2017-06-24 03:58:00 20731 [Note] InnoDB: Using CPU crc32 instructions2017-06-24 03:58:00 20731 [Note] InnoDB: Initializing buffer pool Size = 128.0M2017-06-24 03:58:00 20731 [Note] InnoDB: Completed initialization of buffer pool2017-06-24 03:58:00 20731 [Note] InnoDB: Highest supported file format is Barracuda.2017-06-24 03:58:00 20731 [Note] InnoDB: 128rollback segment (s) are active.2017-06-24 03:58:00 20731 [Note] InnoDB: Waiting for purge to start2017-06-24 03:58:00 20731 [Note] InnoDB: 5.6.36 started Log sequence number 1625977 2017-06-24 03:58:00 20731 [Note] Binlog end2017-06-24 03:58:00 20731 [Note] InnoDB: FTS optimize thread exiting.2017-06-24 03:58:00 20731 [Note] InnoDB: Starting shutdown...2017-06-24 03:58:02 20731 [Note] InnoDB: Shutdown completed; log sequence number 1625987OK
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=/usr/local/mysqldatadir=/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 21366/mysqld
8. Connect to test and change password
* connect through the built-in mysql client
[root@MySQL] # / usr/local/mysql/bin/mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 1Server version: 5.6.36 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 >
* change the password
Mysql > set password = password ('123456'); Query OK, 0 rows affected (0.00 sec)
* reuse password connection
Mysql > quitBye [root@MySQL ~] # / usr/local/mysql/bin/mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [root@MySQL ~] # / usr/local/mysql/bin/mysql-p123456Warning: 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.6.36 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.