Installation and use of mysql on Ubuntu (general version)

Installation and use of mysql on Ubuntu (general version)

Regardless of which version of Ubuntu, installing the MySQL database is basically the same. The following are the specific installation steps:

1. Open the terminal and obtain root privileges

2. Enter in the terminal:

apt-get install mysql-server
apt-get install mysql-client
apt-get install libmysqlclient-dev

During the installation process, you need to enter "Y" to confirm where necessary.

After executing the above three commands, if you want to check whether MySQL is installed successfully, you can enter the following command to check:

netstat -tap | grep mysql

If the following figure appears, the installation is successful.

3. Realize remote control of mysql

(1) Edit the file /etc/mysql/mysql.conf.d/mysqld.cnf and comment out bind-address = 127.0.0.1

As shown in the following figure:

(2) Execute the authorization command under MySQL (authorize any remote computer to log in to the database)

Type mysql -uroot -p yourpassword in the terminal

After entering mysql, type the following command:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your password' WITH GRANT OPTION;

Then refresh the configuration information and type the following command in the terminal:

flush privileges;

When you are finished, use exit to exit mysql.

4. After completing the above steps, restart the MySQL service. The command is as follows:

service mysql restart

After completing the above four steps, the MySQL database can basically be used normally. I hope this article was helpful to you!

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Ubuntu16.04 builds php5.6 web server environment
  • How to build nfs service in ubuntu16.04
  • How to modify the time zone and time in Ubuntu system
  • How to detect Ubuntu version using command line
  • Detailed explanation of how to connect node to mongodb database [Alibaba Cloud Server Environment Ubuntu]
  • Detailed explanation of installing Python 3.7 and pip3 in Ubuntu 16.04 and switching to the default version
  • Tutorial on installing mysql5.7.23 on Ubuntu 18.04
  • Ubuntu 18.04 installs mysql 5.7.23
  • Install mysql5.7 on Ubuntu 18.04
  • Introduction to Ubuntu PostgreSQL installation and configuration

<<:  Docker deployment of Kafka and Spring Kafka implementation

>>:  Reasons and solutions for not being able to detect array changes in Vue2

Recommend

How to modify the sources.list of Ubuntu 18.04 to Alibaba or Tsinghua mirror

1. Backup source list The default source of Ubunt...

Detailed explanation of the cache implementation principle of Vue computed

Table of contents Initialize computed Dependency ...

Several implementation methods of the tab bar (recommended)

Tabs: Category + Description Tag bar: Category =&...

How to deploy and start redis in docker

Deploy redis in docker First install Docker in Li...

Detailed explanation of viewing and setting file permissions on Mac

Preface To modify file permissions in the termina...

Responsive Web Design Learning (2) — Can videos be made responsive?

Previous episode review: Yesterday we talked abou...

Optimize MySQL with 3 simple tweaks

I don't expect to be an expert DBA, but when ...

Before making a web page, let’s take a look at these so-called specifications

This article has compiled some so-called specific...

Summary of practical methods for JS beginners to process arrays

join() method: connects all elements in an array ...

Summary of experience in using div box model

Calculation of the box model <br />Margin + ...

ftp remotely connect to Linux via SSH

First install ssh in Linux, taking centos as an e...

JavaScript implements draggable progress bar

This article shares the specific code of JavaScri...

js realizes the image cutting function

This article example shares the specific code of ...