In Linux systems, MySQL is a very common relational database management system. When installing MySQL, we can choose to install it through a tar compressed package. Next, this article will introduce in detail the process of installing MySQL through tar in Linux systems.
Step one: Download the MySQL installation package
First, we need to download the MySQL installation package from the official MySQL website. On the download page, you can choose the following MySQL version:
In this article, we chose the Community Edition 5.7 version of MySQL for installation. After selecting the corresponding version, we need to click the "Download" button to download.
Step 2: Decompress the MySQL installation package
After the download is completed, we need to decompress the MySQL compressed package. The unzipped folder contains all MySQL installation files. When decompressing, we can use the following command:
tar zxvf mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz
Among them, mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz is the name of the MySQL installation package we downloaded. After using this command, you can decompress the file and generate a folder named mysql-5.7.34-linux-glibc2.12-x86_64.
Step 3: Install MySQL
After decompression, we move the mysql-5.7.34-linux-glibc2.12-x86_64 folder to the directory where we want to install MySQL. After moving the folder, we need to enter the folder:
cd /usr/local cp -r /path/to/mysql-5.7.34-linux-glibc2.12-x86_64 .
After entering the mysql-5.7.34-linux-glibc2.12-x86_64 folder, we need to perform the initialization settings of MySQL. We can use the following command to initialize and configure the root user:
cd mysql-5.7.34-linux-glibc2.12-x86_64 ./bin/mysqld --initialize --user=mysql ./bin/mysql_secure_installation
In the above command, we used the mysqld command to initialize MySQL. After the initialization is completed, we need to use the mysql_secure_installation command to set the root user's password, permissions and other information.
Step 4: Start the MySQL service
Start the MySQL service through the following command:
./bin/mysqld_safe &
After starting the service, we need to use the following command to log in to MySQL:
./bin/mysql -u root -p
At this point, the system will prompt us to enter the root user password we set previously. After successfully logging in, we can happily use MySQL.
Summary:
Through the above method, we introduced in detail how to install MySQL through tar in the Linux system and perform the corresponding initialization settings and operations. It should be noted that when using MySQL, we must pay attention to the security and stability of the environment. At the same time, we must also understand as much as possible the specific operations of MySQL and its security issues.
The above is the detailed content of linux tar installation mysql. For more information, please follow other related articles on the PHP Chinese website!

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool