mysql-5.6.x binary version installation record

Source: Internet
Author: User
Tags account security administrator password

First, operating system installation Environment

1. Operating system: CentOS 6.7 x86_64, operating system basic environment advance preparation process skipped.
2. Binary MySQL version: mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz
3. This installation process is also suitable for mysql-5.5.x binary version of the installation process reference.


Second, installation mysql-5.6.29-linux-glibc2.5-x86_64


1. Download the compiled version of MySQL installation

wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz
Tar zxvf mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz-c/usr/local
cd/usr/local/
LN-SV mysql-5.6.29-linux-glibc2.5-x86_64 MySQL


2. Preparing the MySQL User

Groupadd MySQL
Useradd-g mysql-m-s/sbin/nologin MySQL


3. Initialize MySQL with the default location of the database location

Chown-r Mysql:mysql/usr/local/mysql
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data


4. mysql service configuration

Cd/usr/local/mysql
CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on


5. Configure the MySQL command link, or you can use the Add environment variable, this way can be skipped.

Ln-sf/usr/local/mysql/bin/mysql/usr/bin/mysql
Ln-sf/usr/local/mysql/bin/mysqldump/usr/bin/mysqldump
Ln-sf/usr/local/mysql/bin/myisamchk/usr/bin/myisamchk
Ln-sf/usr/local/mysql/bin/mysqld_safe/usr/bin/mysqld_safe


or by adding an environment variable to the solution.

# Vi/etc/profile
Export path=/usr/local/mysql/bin/: $PATH
# Source/etc/profile


6. Configure Other

Ln-sv/usr/local/mysql/include/usr/include/mysql
echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf
Ldconfig


7. mysql config file, just to be able to start the test

Vi/etc/my.cnf

[client]
port        = 3306
default-character-set  = UTF8
socket      =/tmp/mysql.sock

[mysqld]
character-set-server   = UTF8
collation-server       = Utf8_general_ci
port                    = 3306
socket                  =/tmp/mysql.sock
basedir                 =/usr/local/mysql
datadir                 =/usr/local/mysql/data
skip-external-locking
Key_ buffer_size    = 16M
Max_allowed_packet = 1M
table_open_cache   = +
Sort_buffer_ size   = 512K
net_buffer_length  = 8 k
read_buffer_size   = 256K
Read_rnd_buffer_ size    = 512K
Myisam_sort_buffer_size = 8M

Log-bin=mysql-bin
Binlog_format=mixed
Server-id = 1

[Mysqldump]
Quick
Max_allowed_packet = 16M

[MySQL]
No-auto-rehash

[Myisamchk]
Key_buffer_size = 20M
Sort_buffer_size = 20M
Read_buffer = 2M
Write_buffer = 2M

[Mysqlhotcopy]
Interactive-timeout


8. Start MySQL

Service mysqld Start


9. Modify the Administrator password and test

#/usr/local/mysql/bin/mysqladmin-u root password ' admin ' #设置管理员密码
#/usr/local/mysql/bin/mysql-u Root-p #测试密码输入


10. Configure MySQL account security

/usr/local/mysql/bin/mysql_secure_installation

Note:running all PARTS of this SCRIPT are RECOMMENDED for all MySQL
SERVERS in PRODUCTION use! Please READ each STEP carefully!

In order to log into MySQL to secure it, we'll need the current
Password for the root user. If you ' ve just installed MySQL, and
You haven ' t set the root password yet, the password would be blank,
So, should just press ENTER here.

Enter current password to root (enter for none):
OK, successfully used password, moving on ...

Setting The root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.

You already has a root password set so that you can safely answer ' n '.

Change the root password? [y/n] n
... skipping.

By default, a MySQL installation have an anonymous user, allowing anyone
To log into MySQL without has to has a user account created for
them. This was intended only for testing, and the installation
Go a bit smoother. You should remove them before moving into a
Production environment.

Remove anonymous users? [y/n] Y
... success!

Normally, Root should only is allowed to connect from ' localhost '. This
Ensures that someone cannot guess at the root of password from the network.

Disallow Root login remotely? [y/n] n
... skipping.

By default, MySQL comes with a database named ' test ' that anyone can
Access. This was also intended only for testing, and should be removed
Before moving into a production environment.

Remove test database and access to it? [y/n] Y
-Dropping test database ...
... success!
-Removing privileges on test database ...
... success!

Reloading the privilege tables would ensure that all changes made so far
would take effect immediately.

Reload privilege tables now? [y/n] Y
... success!

All done! If you've completed all of the above steps, your MySQL
Installation should now is secure.

Thanks for using mysql!

Cleaning up ...


This article is from the "Koumm Linux Technology blog" blog, be sure to keep this source http://koumm.blog.51cto.com/703525/1762167

mysql-5.6.x binary version installation record

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.