Install Mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz_mysql under Linux

Source: Internet
Author: User
Tags crc32 deprecated documentation rollback

Download mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz from official website

Create a MySQL user

[Root@master home]# useradd mysql
[root@master data]# echo ' mysql ' |passwd--stdin MySQL

Change the user's password for MySQL.

PASSWD: All authentication tokens have been successfully updated.

Reasons to create a MySQL user

No MySQL user will appear a mistake, tried many times, add MySQL user installation success

* Of course, many times we have created a good other user to complete the day-to-day operation if you do not create a MySQL user, modify the Mysqld_safe file in the Mysql/bin directory;//pro-Test success

Specific steps:

[Root@master bin]# vim mysqld_safe user= ' MySQL ' modified for user= ' Hadoop '//own user The following steps are basically the same * [root@slave1 data]# service MySQL STA RT Starting MySQL ... error!
The server quit without updating PID file (/home/hadoop/ruanjian/mysql/data/slave1.hadoop.pid). [Root@master Data] #vim Slave1.Hadoop.err//view log file 160830 15:56:44 mysqld_safe starting mysqld daemon with databases from/ Home/hadoop/ruanjian/mysql/data 2016-08-30 15:56:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use--explicit_defaults_for_timestamp server option (the documentation for more details). 2016-08-30 15:56:49 1990 [ERROR] Fatal error:can ' t change to run as user ' MySQL ';
Please check this user exists! 2016-08-30 15:56:49 1990 [ERROR] aborting 2016-08-30 15:56:49 1990 [note] Binlog end 2016-08-30 15:56:49 1990 [note]/home /hadoop/ruanjian/mysql/bin/mysqld:shutdown complete 160830 15:56:49 mysqld_safe mysqld from PID file/home/hadoop/ Ruanjian/mysql/data/slave1.hadoop.pid Ended

Create the data directory under MySQL user and unzip

[Root@master data]# tar-zxvf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@master data]# MV mysql-5.6.12-linux-glibc2.5-x86_64 MySQL//rename

Set permissions

[Root@master data]# chown-r mysql:mysql MySQL

Switch users and enter the Mysql/scripts directory

[Root@master data]# su mysql
[mysql@master data]$ cd mysql/scripts/
[Mysql@master scripts]$

Installation (directory based on your own MySQL extract directory set itself)

[Mysql@master scripts]$./mysql_install_db--user=mysql--basedir=/home/mysql/data/mysql--datadir=/home/mysql/data /mysql/data

Output information

Installing MySQL system tables ... 2016-08-30 19:55:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use--explicit_defaults_for_timestamp server option (the documentation for more details). 2016-08-30 19:55:42 1354 [Warning] buffered warning:changed limits:max_open_files:1024 (requested 5000) 2016-08-30 19:5 5:42 1354 [Warning] buffered warning:changed limits:table_cache:431 (requested) 2016-08-30 19:55:42 [note] in Nodb:the InnoDB memory heap are disabled 2016-08-30 19:55:42 1354 [note] innodb:mutexes and rw_locks use GCC atomic built  INS 2016-08-30 19:55:42 1354 [note] innodb:compressed tables use zlib 1.2.3 2016-08-30 19:55:42-1354 [note] Innodb:using  Linux native AIO 2016-08-30 19:55:42 1354 [note] Innodb:not using CPUs CRC32 instructions 2016-08-30 19:55:42 1354 [note] Innodb:initializing buffer pool, size = 128.0M 2016-08-30 19:55:42 1354 [note] innodb:completed initialization of Buffe R Pool 2016-08-30 19:55:42 1354 [note] Innodb:the FIrst specified data file./ibdata1 did not exist:a new database to be created! 2016-08-30 19:55:42 1354 [note] innodb:setting file./ibdata1 size to MB 2016-08-30 19:55:42 1354 [note] Innodb:datab
ASE physically writes the file full:wait ... 2016-08-30 19:55:42 1354 [note] innodb:setting log file./ib_logfile101 size to MB 2016-08-30 19:55:43 1354 [note] Inn odb:setting log file./ib_logfile1 size to MB 2016-08-30 19:55:44 1354 [note] innodb:renaming log file./ib_logfile10 1 to./IB_LOGFILE0 2016-08-30 19:55:44 1354 [Warning] innodb:new log files created, lsn=45781 2016-08-30 19:55:44 1354 [N 
OTE] Innodb:doublewrite buffer not found:creating new 2016-08-30 19:55:44 1354 [note] Innodb:doublewrite buffer created
2016-08-30 19:55:44 1354 [note] innodb:128 rollback segment (s) are active.
2016-08-30 19:55:44 1354 [Warning] innodb:creating FOREIGN KEY constraint system tables. 2016-08-30 19:55:44 1354 [note] innodb:foreign key constraint system tables created 2016-08-30 19: 55:44 1354 [note] innodb:creating tablespace and datafile system tables.
2016-08-30 19:55:44 1354 [note] innodb:tablespace and datafile system tables created.  2016-08-30 19:55:44 1354 [note] innodb:waiting for purge to start 2016-08-30 19:55:44 1354 [note] innodb:5.6.12 started; Log sequence number 0 2016-08-30 19:55:44 1354 [note] Binlog end 2016-08-30 19:55:44 1354 [note] Innodb:fts optimize
EAD exiting.
2016-08-30 19:55:44 1354 [note] innodb:starting shutdown ... 2016-08-30 19:55:46 1354 [note] Innodb:shutdown completed; Log sequence number 1625977 OK Filling help tables ... 2016-08-30 19:55:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use--explicit_defaults_for_timestamp server option (the documentation for more details). 2016-08-30 19:55:46 1377 [Warning] buffered warning:changed limits:max_open_files:1024 (requested 5000) 2016-08-30 19:5 5:46 1377 [Warning] buffered warning:changed limits:table_cache:431 (requested 2000) 2016-08-30 19:55:46 1377 [note] innodb:the InnoDB memory heap are disabled 2016-08-30 19:55:46 1377 [note] innodb:mutexes and rw_locks u Se GCC atomic builtins 2016-08-30 19:55:46 1377 [note] innodb:compressed tables use zlib 1.2.3 2016-08-30 19:55:46 1377 [ Note] innodb:using Linux native AIO 2016-08-30 19:55:46 1377 [note] Innodb:not Using CPU CRC32 Instructions 2016-08-30 1 9:55:46 1377 [note] innodb:initializing buffer pool, size = 128.0M 2016-08-30 19:55:46 1377 [note] innodb:completed Init
Ialization of buffer pool 2016-08-30 19:55:46 1377 [note] innodb:highest supported the file format is barracuda.
2016-08-30 19:55:46 1377 [note] innodb:128 rollback segment (s) are active.  2016-08-30 19:55:46 1377 [note] innodb:waiting for purge to start 2016-08-30 19:55:46 1377 [note] innodb:5.6.12 started; Log sequence number 1625977 2016-08-30 19:55:46 1377 [note] Binlog end 2016-08-30 19:55:46 1377 [note] Innodb:fts Optimi
Ze thread exiting.
2016-08-30 19:55:46 1377 [note] innodb:starting shutdown ... 2016-08-30 19:55:48 1377 [note] Innodb:shutdown completed;  Log sequence number 1625987 OK to start mysqld in boot time for you have to copy Support-files/mysql.server to the right place
For your system, REMEMBER to SET A PASSWORD for the MySQL root USER! To does so, start the server, then issue the following commands:/home/mysql/data/mysql/bin/mysqladmin-u root password ' NE  W-password '/home/mysql/data/mysql/bin/mysqladmin-u root-h master.hadoop password ' new-password ' Alternatively you can Run:/home/mysql/data/mysql/bin/mysql_secure_installation which'll also give you the option of removing the test datab ASEs and anonymous user created by default.
This is strongly recommended for production servers.
The manual for more instructions. You can start the MySQL daemon with:cd. ; /home/mysql/data/mysql/bin/mysqld_safe & can test the MySQL daemon with mysql-test-run.pl CD mysql-test;
Perl mysql-test-run.pl Please have the problems with the/bin/mysqlbug script! The Latest information about MySQL is available on the Web at http://www.mysql.com Support MySQL by buying support/licenses a T http://shop.mysql.com New Default Config file was created as/home/mysql/data/mysql/my.cnf and would is used by default B
Y the server when you start it. You could edit this file to change server Settings Warning:default config FILE/ETC/MY.CNF exists on the system this file W Ill be read by default by the MySQL server If you don't want to use this, either remove it, or use the--defaults-file ar Gument to Mysqld_safe when starting the server

Configuration file

[Mysql@master scripts]$ CD ... /support-files/
[root@master support-files]# cp my-default.cnf/etc/my.cnf
[Root@master support-files]# CP Mysql.server/etc/init.d/mysql
[Root@master support-files]# vim/etc/init.d/mysql//modify MySQL File

Add the following two lines

Basedir=/home/mysql/data/mysql
Datadir=/home/mysql/data/mysql/data

Configure Environment variables

[Root@master support-files]# vim/etc/profile
#set mysql environment
export mysql_home=/home/mysql/data/ MySQL
export path= $MYSQL _home/bin: $PATH

Configure the MySQL service to boot automatically

[Root@master bin]# chkconfig--add mysql//add MySQL
[root@master bin]# chkconfig MySQL on//set boot up

Start MySQL

[root@master support-files]# service MySQL start
env:/etc/init.d/mysql: Insufficient///If prompted to do the following command to reboot
[ Root@master support-files]# chmod a+wrx/etc/init.d/mysql
[root@master support-files]# service MySQL start
Starting MySQL. success! Start successful

Set Root login password

[Root@master ~]# cd/home/mysql/data/mysql/bin///go to MySQL bin directory
[Root@master bin]#./mysqladmin-u root password '] Password '//' password ' password quotes for yourself must not be
[Root@master bin]#./mysqladmin-u root password mysql
[root@master bin]# Mysql-u root-p
Enter Password: 
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 4
server version:5.6.12 mysql Community Server (GPL)
Copyright (c), 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark to Oracle Corporation and/or its
affiliates. The other names may is trademarks of their respective
owners.
Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>

The above is a small set to introduce the Linux installation mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.