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

Four ways to compare JavaScript objects

Table of contents Preface Reference Comparison Ma...

MySQL database constraints and data table design principles

Table of contents 1. Database constraints 1.1 Int...

How to use async await elegantly in JS

Table of contents jQuery's $.ajax The beginni...

IE8 browser will be fully compatible with Web page standards

<br />According to foreign media reports, in...

Linux system file sharing samba configuration tutorial

Table of contents Uninstall and install samba Cre...

Example code for implementing dotted border scrolling effect with CSS

We often see a cool effect where the mouse hovers...

A brief discussion on the perfect adaptation solution for Vue mobile terminal

Preface: Based on a recent medical mobile project...

Use iframe to submit form without refreshing the page

So we introduce an embedding framework to solve th...

How to use an image button as a reset form button

When we make a form, we often set a submit button ...

vue+springboot realizes login function

This article example shares the specific code of ...

Let you understand how HTML and resources are loaded

All content in this blog is licensed under Creati...

Vue implements multiple selections in the bottom pop-up window

This article example shares the specific code of ...

How to achieve centered layout in CSS layout

1. Set the parent container to a table and the ch...