Mysql5.7.8 installation documentation (binary installation) _ MySQL

Source: Internet
Author: User
The binary installation method of Mysql578 installation documentation (binary installation) 57 is about the same as that of 56, but it is not the same in some places. for example, the initialization command should be changed, the initialization commands for minor versions after 57 are also different. The first step of development version 578 is now used. download the installation documentation for MySQL 5.7.8 (binary installation)

The binary installation method of 5.7 is about the same as that of 5.6, but it is not the same in some places. for example, the initialization command should be changed, and the initialization commands for minor versions after 5.7 are also different. Currently, the development version 5.7.8 is used.

Step 1: Download and unzip the binary file, pressurize it, and enter the extracted file

[Root @ mysql47 mysql33333] # ll
Total 160
Drwxr-xr-x 2 7161 wheel 4096 Jul 20 bin
-Rw-r-1 7161 wheel 17987 Jul 20 20:25 COPYING
Drwxr-xr-x 2 7161 wheel 4096 Jul 20 docs
Drwxr-xr-x 3 7161 wheel 4096 Jul 20 include
-Rw-r-1 7161 wheel 106739 Jul 20 INSTALL-BINARY
Drwxr-xr-x 4 7161 wheel 4096 Jul 20 lib
Drwxr-xr-x 4 7161 wheel 4096 Jul 20 man
-Rw-r-1 7161 wheel 2478 Jul 20 README
Drwxr-xr-x 28 7161 wheel 4096 Jul 20 share
Drwxr-xr-x 2 7161 wheel 4096 Jul 20 support-files
[Root @ mysql47 mysql33333] #
No data directory is found. There is no scripts folder for mysql5.6.
I renamed mysql33333.

Step 2: create a data directory under mysql33333

Step 3: change the user of the mysql33333 folder
[Root @ mysql47 local] # chown-R mysql: mysql mysql33333

[Root @ mysql47 mysql33333] # ll
Total 164
Drwxr-xr-x 2 mysql 4096 Jul 20 bin
-Rw-r-1 mysql 17987 Jul 20 COPYING
Drwxr-xr-x 2 mysql 4096 Aug 18 data
Drwxr-xr-x 2 mysql 4096 Jul 20 docs
Drwxr-xr-x 3 mysql 4096 Jul 20 include
-Rw-r-1 mysql 106739 Jul 20 INSTALL-BINARY
Drwxr-xr-x 4 mysql 4096 Jul 20 lib
Drwxr-xr-x 4 mysql 4096 Jul 20 man
-Rw-r-1 mysql 2478 Jul 20 README
Drwxr-xr-x 28 mysql 4096 Jul 20 share
Drwxr-xr-x 2 mysql 4096 Jul 20 support-files
[Root @ mysql47 mysql33333] #

Step 4: initialize the database
Because my version is 5.6.8, install it according to the instructions of the official document. The following are official documents.
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:
[Root @ mysql47 bin] #./mysqld-initialize-basedir =/usr/local/mysql33333-datadir =/usr/local/mysql33333/data &

A warning message will be reported. you can check it. A temporary root password is displayed, but cannot be used when you log on later.

Step 5,./mysql_ssl_rsa_setup-datadir =/usr/local/mysql33333/data

Step 6: In the mysql33333 folder, configure the relevant parameters.

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

Step 6: change the folder mysql33333.

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

Step 7: Use-skip-grant-tables to log on to the database server

The reason for this is that, although the temporary root password is provided in warning during initialization, after I try to start the mysql server normally, you cannot log in with that password.

Step 8: log on to the server and change the root password.

First check the version:
Mysql> select version ();
+ ---- +
| Version () |
+ ---- +
| 5.7.8-rc |
+ ---- +
1 row in set (0.00 sec)

View mysql. user table
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: 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, pasword_expied must be considered and set to N.

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)
Maybe this method is a bit weird. why not directly set password = password ();
Take a look
Mysql> set password = password ('20140901 ');
ERROR 1131 (42000): You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords

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

After the modification is complete, log on to the system as the root user.
Mysql> select current_user ();
+ ------ +
| Current_user () |
+ ------ +
| Root @ localhost |
+ ------ +
1 row in set (0.00 sec)

Log on to OK.

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.