Installation steps of mysql under linux

Installation steps of mysql under linux

1. Download the mysql tar file:

https://dev.mysql.com/downloads/mysql/5.6.html#downloads

2. Enter the directory where the installation package is located

Execute the command: tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz

3. Copy the unzipped mysql directory to the system's local software directory:

Execute the command: cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r

4. Add the system mysql group and mysql user:

Execute the command: groupadd mysql和useradd -r -g mysql mysql

5. Install the database:

Enter the directory where the MySQL software is installed: execute the command cd /usr/local/mysql

Change the owner of the current directory to the mysql user: execute the command chown -R mysql:mysql ./

Install the database: execute the command ./scripts/mysql_install_db --user=mysql

Change the owner of the current directory to the root user: execute the command chown -R root:root ./

Change the owner of the current data directory to the mysql user: execute the command chown -R mysql:mysql data

6. Start the mysql service and add the mysql service to start at boot:

Add startup script: execute the command cp support-files/mysql.server /etc/init.d/mysql to put the startup script in the startup initialization directory

Start the MySQL service: execute the command service mysql start

Execute the command: ps -ef|grep mysql to see the mysql service description started successfully

7. Change the root user password of mysql. The initial root password is empty:

Execute command: ./bin/mysqladmin -u root password '密碼'

8. Put the mysql client in the default path:

ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

Note: It is recommended to use a soft link instead of directly copying the package file to facilitate the installation of multiple versions of MySQL on the system

Summarize

The above is the installation steps of MySQL under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Summary of Problems in Installing MySQL 5.7.19 under Linux
  • How to install multiple mysql5.7.19 (tar.gz) files under Linux
  • MySQL 5.7.19 (tar.gz) installation graphic tutorial under Linux

<<:  How to build gitlab on centos6

>>:  Implement dynamic management and monitoring of docker containers based on spring-boot and docker-java [with complete source code download]

Recommend

js implements the classic minesweeper game

This article example shares the specific code of ...

The problem of form elements and prompt text not being aligned

Recent projects involve the creation of a lot of ...

Talking about the practical application of html mailto (email)

As we all know, mailto is a very practical HTML ta...

Complete step record of Vue encapsulation of general table components

Table of contents Preface Why do we need to encap...

Implementation of Docker CPU Limit

1. --cpu=<value> 1) Specify how much availa...

Html+CSS floating advertisement strip implementation

1.html part Copy code The code is as follows: <...

How to install SVN server under Linux

1. Yum installation yum install subversion 2. Con...

How to check the hard disk size and mount the hard disk in Linux

There are two types of hard disks in Linux: mount...

Solve the 1251 error when establishing a connection between mysql and navicat

I reinstalled the computer and installed the late...

MySQL trigger trigger add, delete, modify and query operation example

This article uses examples to describe the add, d...

Detailed explanation of data types in JavaScript basics

Table of contents 1. Data Type 1.1 Why do we need...