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

Vue implements tab label (label exceeds automatic scrolling)

When the created tab label exceeds the visible ar...

Detailed explanation of the process of using docker to build minio and java sdk

Table of contents 1minio is simple 2 Docker build...

Detailed explanation of JavaScript's built-in objects Math and strings

Table of contents Math Objects Common properties ...

Pure CSS custom multi-line ellipsis problem (from principle to implementation)

How to display text overflow? What are your needs...

JS realizes special effects of web page navigation bar

This article shares with you a practical web navi...

Tutorial diagram of using Jenkins for automated deployment under Windows

Today we will talk about how to use Jenkins+power...

How to automatically back up the mysql database regularly

We all know that data is priceless. If we don’t b...

Shtml Concise Tutorial

Shtml and asp are similar. In files named shtml, s...

CentOS7 uses rpm to install MySQL 5.7 tutorial diagram

1. Download 4 rpm packages mysql-community-client...

Example of how to create and run multiple MySQL containers in Docker

1. Use the mysql/mysql-server:latest image to qui...