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

Vue implements click feedback instructions for water ripple effect

Table of contents Water wave effect Let's see...

Detailed installation tutorial of mysql 5.7 under CentOS 6 and 7

You always need data for development. As a server...

CSS3+HTML5+JS realizes the shrinking and expanding animation effect of a block

When I was working on a project recently, I found...

The connection between JavaScript constructors and prototypes

Table of contents 1. Constructors and prototypes ...

How to display texture at the position of swipe in CocosCreator

Table of contents 1. Project requirements 2. Docu...

Docker uses busybox to create a base image

The first line of a Docker image starts with an i...

Details on how to use class styles in Vue

Table of contents 1. Boolean 2. Expression 3. Mul...

Vue page monitoring user preview time function implementation code

A recent business involves such a requirement tha...

Advantages of MySQL covering indexes

A common suggestion is to create indexes for WHER...

A brief discussion on two methods to solve space-evenly compatibility issues

Since its launch in 2009, flex has been supported...

Summary of MySql import and export methods using mysqldump

Export database data: First open cmd and enter th...

Detailed explanation of Nginx http resource request limit (three methods)

Prerequisite: nginx needs to have the ngx_http_li...

CentOS 7.9 installation and configuration process of zabbix5.0.14

Table of contents 1. Basic environment configurat...