Mysql5.7.8 Installation Documentation (binary installation)

Source: Internet
Author: User

Mysql5.7.8 Installation Documentation (binary installation)

5.7 of the binary installation method is about the same as 5.6, but some places are not the same, for example, the initialization of the command of the change, after 5.7, the small version of the initialization command is not the same. Now using the 5.7.8 of the development version.

The first step is to download the extracted binary files, pressurized, into the extracted files

[email protected] mysql33333]# LL
Total 160
Drwxr-xr-x 2 7161 wheel 4096 Jul 20:54 bin
-rw-r–r–1 7161 wheel 17987 Jul 20:25 COPYING
Drwxr-xr-x 2 7161 wheel 4096 Jul 20:54 docs
Drwxr-xr-x 3 7161 wheel 4096 Jul 20:54 include
-rw-r–r–1 7161 wheel 106739 Jul 20:25 install-binary
Drwxr-xr-x 4 7161 wheel 4096 Jul 20:54 Lib
Drwxr-xr-x 4 7161 wheel 4096 Jul 20:54 man
-rw-r–r–1 7161 wheel 2478 Jul 20:25 README
Drwxr-xr-x 7161 wheel 4096 Jul 20:54 share
Drwxr-xr-x 2 7161 wheel 4096 Jul 20:54 support-files
[Email protected] mysql33333]#
You will find that there is no data directory. There is no previous mysql5.6 scripts folder.
I renamed it, mysql33333.

Step two, set up the data directory under mysql33333

The third step, change the folder mysql33333 the file belongs to the user
[Email protected] local]# chown-r mysql:mysql mysql33333

[email protected] mysql33333]# LL
Total 164
Drwxr-xr-x 2 mysql mysql 4096 Jul 20:54 bin
-rw-r–r–1 MySQL mysql 17987 Jul 20:25 COPYING
Drwxr-xr-x 2 mysql mysql 4096 11:07 data
Drwxr-xr-x 2 mysql mysql 4096 Jul 20:54 docs
Drwxr-xr-x 3 mysql mysql 4096 Jul 20:54 include
-rw-r–r–1 MySQL mysql 106739 Jul 20:25 install-binary
Drwxr-xr-x 4 mysql mysql 4096 Jul 20:54 Lib
Drwxr-xr-x 4 mysql mysql 4096 Jul 20:54 man
-rw-r–r–1 MySQL mysql 2478 Jul 20:25 README
drwxr-xr-x mysql mysql 4096 Jul 20:54 share
Drwxr-xr-x 2 mysql mysql 4096 Jul 20:54 support-files
[Email protected] mysql33333]#

Fourth step, initialize the database
Because my version is 5.6.8. So according to the official document instructions, the installation. The following is a description of the official document.
shell> ln-s Full-path-to-mysql-version-os MySQL
shell> CD MySQL
shell> mkdir Mysql-files
shell> chmod 770 Mysql-files
Shell> chown-r MySQL.
Shell> chgrp-r MySQL.
Shell> Bin/mysql_install_db–user=mysql # before MySQL 5.7.6
shell> bin/mysqld–initialize–user=mysql # mysql 5.7.6 and up
shell> bin/mysql_ssl_rsa_setup # mysql 5.7.6 and up
Shell> chown-r Root.
shell> chown-r MySQL Data mysql-files
Shell> Bin/mysqld_safe–user=mysql &

Next command is optional

shell> CP Support-files/mysql.server/etc/init.d/mysql.server
The command is as follows:
[Email protected] bin]#./mysqld–initialize–basedir=/usr/local/mysql33333–datadir=/usr/local/mysql33333/data &

will be reported warning information, you can look at. Displays the temporary password for a root, but is not available when logging in later.

Fifth step,./mysql_ssl_rsa_setup–datadir=/usr/local/mysql33333/data

Sixth step: Under the mysql33333 folder, and configure the relevant parameters, simple configuration is good.

CP./support-files/my-default.cnf./my.cnf

Sixth step, change the mysql33333 folder to belong to.

Chown-r mysql:mysql/usr/local/mysql33333

Seventh step: Log on to start the database server using the –skip-grant-tables method

The reason to start this way is because, although the initialization of the time, warning has given the root of the temporary password, but I tried to start the MySQL server normally after the password to log in.

Eighth, log in to the server and change the root password.

First look at the version number:
Mysql> select version ();
+ ——— –+
| Version () |
+ ——— –+
| 5.7.8-RC |
+ ——— –+
1 row in Set (0.00 sec)

Watch Mysql.user Watch
Mysql> SELECT * from Mysql.user\g
*****************1. Row*****************
Host:localhost
User:root
Select_priv:y
Insert_priv:y
Update_priv:y
Delete_priv:y
Create_priv:y
Drop_priv:y
Reload_priv:y
Shutdown_priv:y
Process_priv:y
File_priv:y
Grant_priv:y
References_priv:y
Index_priv:y
Alter_priv:y
Show_db_priv:y
Super_priv:y
Create_tmp_table_priv:y
Lock_tables_priv:y
Execute_priv:y
Repl_slave_priv:y
Repl_client_priv:y
Create_view_priv:y
Show_view_priv:y
Create_routine_priv:y
Alter_routine_priv:y
Create_user_priv:y
Event_priv:y
Trigger_priv:y
Create_tablespace_priv:y
Ssl_type:
Ssl_cipher:
X509_issuer:
X509_subject:
max_questions:0
max_updates:0
max_connections:0
max_user_connections:0
Plugin:mysql_native_password
Authentication_string: *D5F86FA8F536F9E81C12E8A993EF5292A90259FB
Password_expired:y
Password_last_changed:2015-08-18 11:11:39
Password_lifetime:null
Account_locked:n
1 row in Set (0.00 sec)

There is only one root account, and the password has expired.
When changing the password here, to consider the pasword_expied, set to N, can be used.

Change Password:
mysql> Update Mysql.user Set Authentication_string=password (' Redhat '), password_expired= ' N ' where user= ' root ';
Query OK, 1 row affected, 1 Warning (0.00 sec)
Rows matched:1 changed:1 warnings:1

mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
May feel this method a bit weird, why not directly set Password=password ();
Take a look
Mysql> set Password=password (' 123 ');
ERROR 1131 (42000): You is using MySQL as an anonymous user and anonymous users is not allowed to change passwords

The answer is no, because the Mysql.user table already does not have this field.

After the modification is complete, log in with Root.
Mysql> select Current_User ();
+ —————-+
| Current_User () |
+ —————-+
| [Email protected] |
+ —————-+
1 row in Set (0.00 sec)

Login OK.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Mysql5.7.8 Installation Documentation (binary installation)

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.