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

Ubuntu 18.04 steps to configure mysql and configure a remote connection

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Preface

This article mainly shares with you about the configuration of mysql and remote connection of Ubuntu 18.04. share it for your reference and learning. let's take a look at the detailed introduction.

The configuration tutorial is as follows:

First of all, as we all know, there are three big tricks without saying anything:

Sudo apt-get install mysql-serversudo apt isntall mysql-clientsudo apt install libmysqlclient-dev

After these three steps, the mysql is installed, and then we secretly check it out.

Sudo netstat-tap | grep mysql

Well, in fact, this test is of no use.

Next, you may wonder, the database does not have a password. I've never seen you set a password.

Have no choice but to take a peek at the alternate password.

Sudo vim / etc/mysql/debian.cnf

Open this file with vim and see the following:

OK, yes, debian-sys-maint is the alternate user name, the following string is very high, the long one is the password

# then you can log in after entering your password using mysql-u debain-sys-maint-p #

Please change your password after logging in.

It is said that changing the password is actually adding a user, using middle-aged and elderly surfing the Internet, we add ourselves a user:

Mysql > grant all on *. * to admin@ "%" identified by "123"; # admin is your user name, 123 is the password, and give it full permissions

Then take out the basic syntax of mysql to see if it has been added successfully.

Mysql > select User,Host from mysql.user # to see if your user name has been added, and whether it is * permission

Then exit ();!

Restart it.

Sudo / etc/init.d/mysql restart

Remote connection? how to do it? this is simple. Pull out the administrator mode.

Sudo su # enter administrator sudo vim / etc/mysql/mysql.conf.d/mysqld.cnf # Open this file # precede the line 127.0.0.0 with a # number,: W save: Q exit

Restart again, solve the problem, you can log in with nevicat for nothing!

Summary

The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

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: 0

*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

Database

Wechat

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

12
Report