Tag Archives: ip

The solution of 2003 can’t connect to MySQL server on ‘localhost’ (10061)

Front end developers must read! Starting from scratch, teach you to build a low code website platform in stages>>>

Problem description

Bloggers today use the database to find such a problem:

The Internet said that the database needs to be configured, but they didn’t come to the point. We need to configure the remote access port of the server

Answer to the question

Use the following command:

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

Then change the place in the figure to 0.0.0.0:

Don’t forget to restart MySQL service:

sudo service mysql restart

Then run again, you can connect

Solve the IP assignment prompt error, some other host already use address

What are the eight life cycle hook functions of Vue>>>

In VM and other virtual machines, when the network card is configured as static IP, the network card will always report “error, some other host already uses address” even if it is changed to other IP, sometimes similar situation will still occur, and DHCP will work normally, which is really painful. After checking on the Internet for a long time, I think the following method is the most “fierce”! But before doing so, make sure that the network really uses the IP address you want to use, otherwise it will cause a real conflict

1. Edit/etc/sysconfig/network scripts/ifup eth to

if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; Then
echo $”error, some other host already uses address ${IPADDR}.
Exit 1
fi
annotate and save it

2. Enter the command to restart the network service

#Service network restart restart the network service, and the network card is loaded successfully

Error in configuring static IP in Ubuntu 18.04

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Note:

Because many test environments are installed on this Ubuntu system, but due to the restart and power failure of the virtual server, every time IP changes, the environment has to be updated, so the IP of the environment needs to be configured as static, once and for all

According to the previous experience of configuring Ubuntu static IP, VI/etc/network/interfaces directly configures the static IP under this file. After resetting the network, it is found that it does not take effect

So I checked the version of Ubuntu, which is 18.04. Then Baidu found that “since 17.10, Ubuntu has given up the configuration of fixed IP in/etc/network/interfaces. Even if the configuration does not take effect, it will be changed to the netplan mode, and the configuration is written in/etc/netplan/01-netcfg.yaml or similar yaml file”. So I configured according to the found method, As a result, I encountered a lot of errors and almost vomited blood. Here I write down the errors I encountered

1. The initial configuration is as follows: invalid yaml at// etc/netplan/01-netcfg.yaml line 11 column 11: mapping values are not allowed in this context

Solution: yaml is a hierarchical structure, which needs to be indented. Colon (:) represents dictionary, hyphen (-) represents list, and there must be a space after colon

2. After adding a space after the colon (as shown in the figure below), execute netplan apply and report an error again: invalid yaml at// etc/netplan/01-netcfg.yaml line 11 column 6: did not find expected key

Solution: nameservers should be the fourth layer like gateway 4, and addresses after nameservers should be the fifth layer

The correct number of layers is as follows:

First floor –

network:

Layer 2 – Ethernet:

The third layer – ens33:

The fourth layer addresses: [172.18.0.31/24]

The fourth layer gateway4: 172.18.0.1
0

The fourth layer – nameservers:

The fifth floor

addresses: [114.114.114.114, 8.8.8.8]

3. After solving the problem according to the above method, execute netplan apply as shown in the figure below, and report an error again: error in network definition// etc/netplan/01-netcfg.yaml line 8 column 16: expected scalar

Solution: the address of gateway4 has no brackets. After modification, restart the network service and it will be normal (netplan apply)

So the correct configuration format should be as follows: in this way, the static IP is successfully configured

I didn’t get the wrong report:

A similar error appears: Line8 column 6: cloud not find expected ‘:’ # the prompt is colon: there is no space after it

Similar error occurred:

Netplan found character that cannot start any token, the prompt is that the configuration document is not written according to five levels, and the next level must be one or more spaces than the previous level.

In short: here restart the network times wrong, mostly the level is wrong, wrong format, no space