search
HomeDatabaseMysql TutorialHow to install MySQL 8.0 in Ubuntu 18.04

MySQL Community Server is a free, open source, popular, cross-platform database management system. It supports both SQL and NoSQL and has a pluggable storage engine architecture. Additionally, it provides multiple database connectors for different programming languages, allowing you to develop applications using any known language and many other features.

How to install MySQL 8.0 in Ubuntu 18.04

It has many use cases in areas such as document storage, cloud computing, high availability systems, IoT, hadoop, big data, data warehouses, LAMP or LEMP stacks, etc. for Support large-capacity websites/applications, etc.

Recommended reference study: "mysql tutorial"http://www.php.cn/course/list/51.html

In this article, we will explain the fresh installation of MySQL 8.0 database system on Ubuntu 18.04 Bionic Beaver.

Step 1: Add MySQL Apt Repository

There is an APT repository for installing MySQL server, client and other components. You need to add this MySQL repository to your system's list of package sources; first download the repository package using the wget tool from the command line.

$ wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb

Then use the following dpkg command to install the MySQL repository package.

$ sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb

Please note that during the package installation process, you will be prompted to select the MySQL server version and other components such as clustering, shared client libraries, or MySQL workbench to configure for installation.

mysql-8.0 will automatically select the MySQL server version, then scroll down to the last option Ok and click [Enter] to complete the configuration and installation of the release package as shown in the screenshot.

How to install MySQL 8.0 in Ubuntu 18.04

Step 2: Install MySQL Server in Ubuntu 18.04

Next, download the Recently added MySQL repositories) download the latest package information.

$ sudo apt update

Then run the following commands to install packages for MySQL community server, client and database common files.

$ sudo apt-get install mysql-server

How to install MySQL 8.0 in Ubuntu 18.04

Through the installation process, you will be asked to enter the password for the root user of your MySQL server, please re-enter the password to confirm and press [Enter].

How to install MySQL 8.0 in Ubuntu 18.04

Next, the MySQL Server Authentication Plugin Configuration message will be displayed, read through it and use the right arrow to select Ok and press [Enter] to continue.

How to install MySQL 8.0 in Ubuntu 18.04

You will then be asked to select the default authentication plugin to use, then use the right arrow to select Ok and press [Enter] to complete the package configuration.

How to install MySQL 8.0 in Ubuntu 18.04

Step 3: Securing MySQL Server Installation

By default, MySQL installation is not secure. To secure it, run the security script included with the binary package. You will be asked to enter the root password you set during installation. Then also choose whether to use the VALIDATE PASSWORD plug-in.

You can also change the root password you set previously (as we did in this example). Then enter yes/y the following security question:

Delete anonymous user? (Press y | Y for yes, any other key for no): y

Remote login prohibited? (Press y|Y for yes, any other key for no):y

Delete the test database and access it? (Press y|Y for yes, any other key for no): y

Now reload the permissions table? (Press y|Y for yes, any other key for no):y

Start the script by issuing the following command.

$ sudo mysql_secure_installation

How to install MySQL 8.0 in Ubuntu 18.04

Step 4: Manage MySQL Server via Systemd

On Ubuntu, after installing the package, once the package is configured , its service will usually start automatically. You can check if the MySQL server is up and running using the following command.

$ sudo systemctl status mysql

How to install MySQL 8.0 in Ubuntu 18.04

If for some reason, it does not start automatically, use the following command to start it and enable it to start on system startup as shown below.

$ sudo systemctl status mysql $ sudo systemctl enable mysql

第5步:安装额外的MySQL产品和组件

此外,您可以安装额外的MySQL组件,以便与服务器一起使用,例如mysql-workbench-community,libmysqlclient18和许多其他组件。

$ sudo apt-get update 
$ sudo apt-get install mysql-workbench-community libmysqlclient18

最后,要访问MySQL shell,请发出以下命令。

$ sudo mysql -u root -p

How to install MySQL 8.0 in Ubuntu 18.04

本篇文章就是关于在Ubuntu 18.04中安装MySQL 8.0的安装步骤介绍,希望对需要的朋友有所帮助!

The above is the detailed content of How to install MySQL 8.0 in Ubuntu 18.04. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

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

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

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]

How do you handle large datasets in MySQL?How do you handle large datasets in MySQL?Mar 21, 2025 pm 12:15 PM

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

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

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

How do you drop a table in MySQL using the DROP TABLE statement?How do you drop a table in MySQL using the DROP TABLE statement?Mar 19, 2025 pm 03:52 PM

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.

How do you represent relationships using foreign keys?How do you represent relationships using foreign keys?Mar 19, 2025 pm 03:48 PM

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

How do you create indexes on JSON columns?How do you create indexes on JSON columns?Mar 21, 2025 pm 12:13 PM

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.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?Mar 18, 2025 pm 12:00 PM

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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools