Get the App
SLTechnology News&Howtos  ›  Database  › 

Install MySQL-5.7.17 with general binary installation package under Linux

Shulou Source: shulou.com Published: 2022-06-01 09:00:53 11月10日 Update

Decompress the copy

Mv mysql-5.7.14-linux-glibc2.5-i686 / usr/local/mysql

Create a mysql user first

Groupadd mysqluseradd-r-g mysql-s / bin/false mysql

Create a data directory for mysql that will be used when initializing the database

Mkdir / mysql/ mysql/data / mysql/log

Modify directory permissions

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

Create a my.cnf file

Vim / etc/my.cnf

= / tmp/== = / tmp/= / usr/local/= / mysql/-file = / mysql/data/= = = = [innodb] = = = [log] = / mysql/log/mysql-= / mysql/log/mysql-

Description: here are just some simple configurations.

Initialize the database

The initialization method before 5.7.6 is: bin/mysql_install_db-- user=mysql

I downloaded the latest version 5.7.12, which was just released on April 12th. The version after 5.7.6 initializes the database and no longer uses mysql_install_db.

Bin/mysqld-initialize-user=mysql-basedir=/usr/local/mysql-datadir=/mysql/data-innodb_undo_tablespaces=3-explicit_defaults_for_timestamp

If log_error for my.cnf is configured, the initial password is in the log_error file, otherwise it will be printed.

Bin/mysql_ssl_rsa_setup-datadir=/mysql/data

Modify directory permissions

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

Configure the startup file

Cp support-files/mysql.server / etc/init.d/mysqlchkconfig-- add mysqlchkconfig mysql onservice mysql start

Configure environment variables

Mysql_home=/usr/local/mysqlPATH=$PATH:$mysql_home/binsource / etc/profile

Modify the password

The field in which the password is stored in 5.7is no longer password, it becomes authentication_string

Update mysql.user set authentication_string=password ('root') where user='root'

After changing the root password, if you log in to the mysql system for the first time using root users, you will need to reset the root password.

SET PASSWORD=PASSWORD ('root'); flush privileges

MySQL5.7.17 binary package: https://share.weiyun.com/247aaa9f3784e18cd707040321ec54e4

Tags: Password data directory configuration database file permission version user binary variable just field copy method time environment first time system storage Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi OPPO Reno Apple Shulou Tech Info