Graphic tutorial of mysql 5.7. 16 installation free version under linux

  • 2021-07-03 00:59:06
  • OfStack

In this article, we share the installation-free version tutorial of mysql 5.7. 16 for your reference. The details are as follows

MySQL: 5.7.16
Program Directory:/usr/local/MySQL
Data file directory:/data/mysql

Download address http://dev.mysql.com/downloads/mysql/; Linux-Generic is an installation-free version, and I chose 64-bit

Specific installation method mysql website has documents, good English words don't look at what I wrote.

1. Prepare before installation

Step 1 Turn off the firewall

Close in # setup

2. Turn off selinux # This item does not test whether it is required


shell>vi /etc/selinux/config
SELINUX=disabled # SELINUX Parameter enforcing Represents open, disabled Representative closed 


3. Set up an myql account


shell> useradd mysql


4. mysql depends on libaio library. Query and install libaio library


shell> yum search libaio
shell> yum install libaio


5. Inquire whether the system has an old version of myql, please delete it. # Query method: rpm qagrep mysql

6. Download mysql 5.7. 16


shell>wget http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz 

2. mysql installation

1. Unzip the installation file; Copy to/usr/local/mysql


shell>tar  In fact, in fact, the zxvf mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz
shell>cp -R mysql-5.7.16-linux-glibc2.5-x86_64 /usr/local/mysql

2. Configuration/etc/my. cnf


shell>vi/etc/my.cnf
[mysqld]
#skip-grant-tables
# Specify a single table Engine 
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
datadir=/data/mysql
basedir=/usr/local/mysql
 
##open sqllog
general_log=ON
general_log_file=/data/mysql/query.log
 
 
# Start the event plan 
event_scheduler = 1
 
# Open bin-log
log_bin=/data/bin/mysql-bin
server-id=230
#explicit_defaults_for_timestamp=true
 

3. Modify the root account number. bash_profile


shell> vi/root/.bash_profile
#PATH=$PATH:$HOME/bin
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin

4. mysql installation


shell>cd /usr/local/mysql/
shell>bin/mysqld  In fact, in fact, the initialize # Remember the temporary password 
shell>bin/mysql_ssl_rsa_setup
shell>bin/mysqld_safe --user=mysql&
shell>chown -R mysql:mysql /usr/local/mysql/ # Change authority 
shell>mkdir  In fact, in fact, the p /data/mysql  # Establish a data file directory and authorize it 
shell>chown  In fact, in fact, the R mysql:mysql /data/mysql
 

5. Start mysql and set up boot


shell>cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
shell>servicemysqld start
shell>chkconfig --add mysqld # Join the boot boot 

6. Log in to mysql


shell>mysql  In fact, in fact, the uroot  In fact, in fact, the p # Enter the previous temporary password 
shell> alter user 'root'@'localhost'identified by "fineex.1";

Note: After logging in this version, you must change your password before you can perform other database operations.


shell> useradd mysql


0

Wonderful topic sharing: mysql installation tutorials for different versions mysql5.7 installation tutorials for different versions mysql5.6 installation tutorials


Related articles: