Weekend report

Time:2022-5-14

Installation system

It’s not very convenient to use Ubuntu, so I wanted to install a black apple. As a result, I didn’t install it for two or three days. I couldn’t reinstall it again, and then restart the environment. I encountered some problems in the process of starting the environment. Although the black apple didn’t install it, I had a better understanding of Ubuntu after this toss.

About Ubuntu download source

There was a problem installing some software

Weekend report

Weekend report

For these two kinds of error reports, after searching online, it is found that it is the problem of download source. Of course, the solution is to switch the download source. At first, I only encounter the first error report. I think it is because of the agent problem. With the experience of solving the first error report, the second error report prompts very clearly. Naturally, I think it is the problem of download source, which is also easy to solve.

Switch download source

Decide that the source file of Ubuntu download is / etc / apt / sources list
Weekend report
Modify the download source directly The content of the list is enough
Remember to backup and execute before modification

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

After backup, you can modify it directly with vim

sudo vim sources.list

Save exit after modification
Then execute the following command to make the changes effective

sudo apt-get update
sudo apt-get upgrade
#Ali source
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

Third party source link

If it still doesn’t work after modification, try more
You can create several more files to store different sources respectively to facilitate switching
Weekend report

Ubuntu create shortcut

I used to think that some applications of Ubuntu have no shortcuts, so they can only be started by command. After reinstalling the system, reinstall webstorm. After reading an article, I knew that I could create shortcuts by myself.
Briefly introduce the creation of shortcuts by webstorm and idea, which will be used in the future. Different application methods may be different, but the two applications are the same.
First, unzip the downloaded installation file and move it to the / opt file
implement

Sudo MV file name file address

The file can be moved
Note that you cannot copy and paste directly because of permission problems
Weekend report

Then create webstorm.com under / usr / share / applications desktop
In webstorm Add the following code to desktop

[Desktop Entry]
Name = WebStorm
Comment = WebStorm
Icon= /opt/WebStorm-213.6461.79/bin/webstorm.png
Terminal=false
Type=Application

The method of idea is the same. You only need to modify the file name and the name in the code
Note that the name of the file downloaded and unzipped by webstorm-213.6461.79 may be different
Explain it briefly

Exec = /opt/WebStorm-213.6461.79/bin/webstorm.sh

Describes the startup file of the application

Icon= /opt/WebStorm-213.6461.79/bin/webstorm.png

Picture illustrating the shortcut

Not all applications are applicable to the above code. You can check it online according to your needs

Problems encountered in learning springboot

First question
Weekend report

terms of settlement
In POM Thafym engine dependency XML configuration file:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Thymeleaf introduction

Second question
There was a problem linking the database

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:

    Property: driver-class-name
    Value: com.mysql.cj.jdbc.Driver
    Origin: "driverClassName" from property source "source"
    Reason: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader

Action:

Update your application's configuration

Then I found that someone had the same problem with me after searching online
Weekend report
In POM XML is added to the above code to solve the problem.
pom. XML is similar to package. XML in angular JSON, which declares the package required by the project, and then Maven downloads the corresponding package according to this file. Similar to Maven.

There are also some small problems caused by carelessness
Weekend report

Weekend report

Understanding of SQL statements

At that time, I didn’t learn SQL statements when learning ThinkPHP. The code for building the database given in the tutorial is directly copied and pasted. When I build my own table, I also modify it directly on the ready-made code. I don’t know what I mean at all, or edit the table directly on Navicat.
Although it is found that SQL statements are basically useless after learning the tutorial in the future, it is still necessary to have a look

SET NAMES utf8mb4; ➊
SET FOREIGN_KEY_CHECKS = 0; ➋

-- ----------------------------     ➌
-- Table structure for teacher  ➌
-- ----------------------------     ➌
DROP TABLE IF EXISTS `teacher`; ➍
CREATE TABLE `teacher` ( ➎
  `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT, ➏
  `Name ` varchar (255) default '' comment ', ➐
  `Sex ` tinyint (1) unsigned not null default '0' comment '0 male, 1 female',
  `Username ` varchar (255) not null comment 'username',
  `Email ` varchar (255) default '' comment 'mailbox',
  `create_ Time ` bigint (11) unsigned not null default '0' comment 'creation time',
  `update_ Time ` bigint (11) unsigned not null default '0' comment 'update time',
  PRIMARY KEY (`id`), ➑
  UNIQUE KEY `nx1HkMqiUveGnJz5lHE7mEcFI5WVew3iXbv3HCwF` (`username`) USING BTREE ➒
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; ➓

-- ----------------------------  ➌
-- Records of teacher           ➌
-- ----------------------------  ➌
BEGIN;  ➊➋
Insert into ` teacher ` values (1, 'Zhang San', 0, 'Zhangsan', ' [email protected] ', 1569721598000, 1569721598000);   ➊➌
Insert into ` teacher ` values (2, 'Li Si', 0, 'Lisi', ' [email protected] ', 1569721598000, 1569721598000);
COMMIT; ➊➍ 

SET FOREIGN_KEY_CHECKS = 1; ➊➎

➊ set the code to utf8mb4
➋ turn off foreign key check
➌ notes
➍ if the table exists, delete the old table
➎ create data table
➏ create an int type field with a display length of 11 and an unsigned number. Null is not allowed. The field is automatically added
➐ create a varchar variable word length string type field with a maximum length of 255
➑ declare primary key
➒ set unique index on username field
➓ set the engine to InnoDB, the self increment is 3, and the default character code is utf8mb4
➊ ➋ open transaction
➊ ➌ insert data
➊ ➍ commit transaction
➊ ➎ open foreign key inspection

summary

Tossing the system wasted too much time, but it didn’t get nothing. I started Ubuntu again. I have a better understanding of Ubuntu. Now I find that Ubuntu is not easy to use, but I can’t use it