Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MySQL on Ubuntu

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install MySQL on Ubuntu, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Server-side installation

The easiest way to install MySQL on Ubuntu is to install it online. Just a few lines of simple commands (# followed by comments):

# install MySQL server, core program sudo apt-get install mysql-server#, install MySQL client sudo apt-get install mysql-client

During the installation process, you will be prompted to confirm the input of YES, set the root user password (which can also be changed later), etc., and wait a moment for the installation to be successful.

After the installation is complete, use the command to verify that the installation and startup is successful:

Sudo ps-ef | grep mysql

The mysql server has been installed in the ubuntu image currently used, so it no longer needs to be installed, and it is set to boot.

The server is used to receive requests from clients, execute sql statements, and manage databases.

The server side is generally managed as a service, with the name mysql

Start the service

Sudo service mysql start

Check to see if a mysql service exists in the process

Ps ajx | grep mysql

Out of Service

Sudo service mysql stop

Restart the service

Sudo service mysql restart configuration

The configuration file directory is / etc/mysql/mysql.cnf

Enter the conf.d directory, open mysql.cnf, and find that it is not configured

Go to the mysql.conf.d directory, open mysql.cnf, and you can see the configuration items

Sudo vim / etc/mysql/mysql.conf.d/mysqld.cnf

The main configuration items are as follows

Bind-address represents the ip bound by the server, defaults to 127.0.0.1port for port, defaults to 3306datadir for database directory, defaults to / var/lib/mysqlgeneral_log_file for general logs, defaults to / var/log/mysql/mysql.loglog_error for error logs, and defaults to / var/log/mysql/error.log for all the contents of this article "how to install MySQL on Ubuntu". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 289

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report