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

Linux installs mysql and configures instances of public network access

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

Share

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

Configuration step

1. Check if DNS is configured

If you do not configure DNS, please refer to the previous section to configure DNS.

Configuration related

If you can't find the DNS of the Linux software library without configuring the DNS yum command, you can configure a free DNS1=114.114.114.114, or you can add a backup DNS2=119.29.29.29.

two。 Install mysql with yum

Yum-y install mysql mysql-server mysql-dev

Here we use yum to do the-y consent operation, and the next three softwares are mysql and mysql-server,mysql-dev independent sequence.

3. Start the mysql service

Service mysqld start

The service needs to be started here, otherwise subsequent operations cannot be carried out.

4. Configure mysql default password

Mysqladmin-u root password 'xxxxx'

Configure root password. In general, many external software are inaccessible without password configuration.

5. Configure external network access

Login default root user login command full name is mysql-u root-p

Mysql-p (beginners had better practice with the full name of the command, because if you log in with an abbreviated command after work, the default is root user. If you misoperate, it will bring unexpected results!)

Use mysql; update user set host='%' where user='root' and host='localhost'

6. Update permissions

Flush privileges; exit

You cannot update the user table without updating permissions

7. Configure the firewall

Service iptables stop chkconfig iptables off

The firewall has an ip forbidden table, which forbids access by default except port 22.

8. Configure mysql service to boot automatically

Chkconfig mysqld on

Set the mysql service to boot automatically

It makes sense to configure the firewall above.

9. At this point, try to access it using the public network.

Write at the end

About the configuration of mysql, you must practice more and be familiar with the operation. Practice more than 3 times a day.

The above example of Linux installing mysql and configuring public network access is all the content shared by the editor. I hope I can give you a reference and support it.

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