Download address: https://dev.mysql.com/downloads/mysql/5.7.html#downloads Upload to server rz-be Unzip the file tar -xvf mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz Move and rename it mv mysql-5.7.36-linux-glibc2.12-x86_64 /usr/local/mysql Create mysql user groups and users and modify permissions groupadd mysql useradd -r -g mysql mysql If groupadd: group 'mysql' already exists appears, ignore it because you have installed mysql before, just skip it Create a data directory and grant permissions mkdir -p /data/mysql #Create directory chown mysql:mysql -R /data/mysql #Give permissions Configure my.cnf vim /etc/my.cnf The content is as follows [mysqld] bind-address=0.0.0.0 port=3306 user=mysql basedir=/usr/local/mysql datadir=/data/mysql socket=/tmp/mysql.sock log-error=/data/mysql/mysql.err pid-file=/data/mysql/mysql.pid #character config character_set_server=utf8mb4 symbolic-links=0 explicit_defaults_for_timestamp=true innodb_log_file_size = 512M max_allowed_packet = 200M After editing: wq! Save and exit Initialize the database Enter the mysql bin directory cd /usr/local/mysql/bin/ initialization ./mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --user=mysql --initialize View Password cat /data/mysql/mysql.err Start mysql and change the root password First place mysql.server in /etc/init.d/mysql cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql Start mysql and view the mysql process service mysql start ps -ef | grep mysql This means that MySQL has been installed successfully. Next, change the password. First log in to MySQL. The previous one is randomly generated. ./mysql -u root -p #bin directory Follow the next five steps and log in again. SET PASSWORD = PASSWORD('123456'); ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; FLUSH PRIVILEGES; update user set host = '%' where user = 'root'; #Enable root to access from any host FLUSH PRIVILEGES;#Refresh Connect to mysql visualization tool Finish This is the end of this article about the tutorial on installing mysql5.7.36 database in Linux environment. For more relevant content about installing mysql5.7.36 in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: About browser compatibility issues encountered and solutions (recommended)
>>: Detailed explanation of JSONObject usage
Computed properties Sometimes we put too much log...
Table of contents Browser Same Origin Policy 1. V...
First, what is box collapse? Elements that should...
MySQL8.0.22 installation and configuration (super...
Table of contents 1. Introduction to import_table...
Placing a search box in the top menu bar is a com...
In Ubuntu, you often encounter the situation wher...
This article example shares the specific code of ...
Given a div with the following background image: ...
MySQL 5.5 installation and configuration method g...
Table of contents Preface Case optimization summa...
Why? The simplest way to put it is that pixels are...
Let’s look at an example first Copy code The code ...
1. If MySQL is not started successfully, check th...
Overview Prometheus is an open source service mon...