Get the App
SLTechnology News&Howtos  ›  Database  › 

Linux system downloads detailed tutorials for installing Mysql

Shulou Source: shulou.com Published: 2022-06-01 19:31:14 10月04日 Update

This article mainly introduces the Linux system download and installation of Mysql detailed tutorials, the contents of the articles are carefully selected and edited by the author, with a certain pertinence, for everyone's reference significance is still relatively great, the following with the author to understand the Linux system download and install Mysql detailed tutorials.

1: download Mysql

Download address: http://dev.mysql.com/downloads/mysql/5.6.html#downloads

Download version: 5.6.33, general version, 64-bit under linux

You can also directly copy the 64-bit download address and download it with the command: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

Extract the mysql package: tar-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

2: copy the extracted mysql directory to the system's local software directory

Execute the command: cp mysql-5.6.33-linux-glibc2.5-x86_64 / usr/local/mysql-r

3: add system mysql groups and mysql users

Execute commands: groupadd mysql and useradd-r-g mysql mysql

4: install the database

Enter the directory to install the mysql software: execute the command cd / usr/local/mysql

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

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

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

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

Installation of this database is complete

5: start mysql service and add boot to start mysql service

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

Start the mysql service: execute the command service mysql start

Execute command: ps-ef | when grep mysql sees the mysql service, it indicates that it started successfully, as shown in the figure.

6: modify the root password of mysql. The initial password of root is empty:

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

7: 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 soft chain, do not directly package file copy, to facilitate the system to install multiple versions of mysql

After reading the above detailed tutorials on downloading and installing Mysql in Linux system, many readers must have some understanding. If you need more industry knowledge and information, you can continue to follow our industry information column.

Tags: Commands directories systems users services tutorials passwords owners data databases addresses versions authors industries software success information content multiple customers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Information OPPO Reno Linux Microsoft