mysql80-DBA数据库学习1-数据库安装

掌握能力

核心技能

核心技能

mysql部署

官网地址www.mysql.com  或者www.oracle.com

https://dev.mysql.com/downloads/repo/yum/

Install the RPM you downloaded for your system, for example:

yum install mysql80-community-release-{platform}-{version-number}.noarch.rpm

yum repolist

(3/3): mysql80-community/x86_64/primary_db                                               | 278 kB  00:00:01     
源标识                                                   源名称                                            状态
!c7-media                                                CentOS-7 - Media                                  4,070
mysql-connectors-community/x86_64                        MySQL Connectors Community                          242
mysql-tools-community/x86_64                             MySQL Tools Community                               104
mysql80-community/x86_64                                 MySQL 8.0 Community Server                          465
repolist: 4,881

新安装了三个关于mysql的仓库

[root@localhost ~]# yum repolist all | grep mysq

[root@localhost ~]# yum repolist all | grep mysq
file:///media/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/repodata/repomd.xml"
正在尝试其它镜像。
mysql-cluster-7.5-community/x86_64                  MySQL Cluster 7. 禁用
mysql-cluster-7.5-community-source                  MySQL Cluster 7. 禁用
mysql-cluster-7.6-community/x86_64                  MySQL Cluster 7. 禁用
mysql-cluster-7.6-community-source                  MySQL Cluster 7. 禁用
mysql-cluster-8.0-community/x86_64                  MySQL Cluster 8. 禁用
mysql-cluster-8.0-community-debuginfo/x86_64        MySQL Cluster 8. 禁用
mysql-cluster-8.0-community-source                  MySQL Cluster 8. 禁用
mysql-cluster-innovation-community/x86_64           MySQL Cluster In 禁用
mysql-cluster-innovation-community-debuginfo/x86_64 MySQL Cluster In 禁用
mysql-cluster-innovation-community-source           MySQL Cluster In 禁用
mysql-connectors-community/x86_64                   MySQL Connectors 启用:   242
mysql-connectors-community-debuginfo/x86_64         MySQL Connectors 禁用
mysql-connectors-community-source                   MySQL Connectors 禁用
mysql-innovation-community/x86_64                   MySQL Innovation 禁用
mysql-innovation-community-debuginfo/x86_64         MySQL Innovation 禁用
mysql-innovation-community-source                   MySQL Innovation 禁用
mysql-tools-community/x86_64                        MySQL Tools Comm 启用:   104
mysql-tools-community-debuginfo/x86_64              MySQL Tools Comm 禁用
mysql-tools-community-source                        MySQL Tools Comm 禁用
mysql-tools-innovation-community/x86_64             MySQL Tools Inno 禁用
mysql-tools-innovation-community-debuginfo/x86_64   MySQL Tools Inno 禁用
mysql-tools-innovation-community-source             MySQL Tools Inno 禁用
mysql-tools-preview/x86_64                          MySQL Tools Prev 禁用
mysql-tools-preview-source                          MySQL Tools Prev 禁用
mysql57-community/x86_64                            MySQL 5.7 Commun 禁用
mysql57-community-source                            MySQL 5.7 Commun 禁用
mysql80-community/x86_64                            MySQL 8.0 Commun 启用:   465
mysql80-community-debuginfo/x86_64                  MySQL 8.0 Commun 禁用
mysql80-community-source                            MySQL 8.0 Commun 禁用

Install MySQL by the following command (for dnf-enabled systems, replace yum in the command ):

$> sudo yum install mysql-community-server

Start the MySQL server with the following command:

$> systemctl start mysqld

You can check the status of the MySQL server with the following command:

$> systemctl status mysqld
$>systemctl enable mysqld

mysql -uroot -p 登录异常,

A superuser account 'root'@'localhost is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

$> sudo grep 'temporary password' /var/log/mysqld.log
[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log
2024-03-20T09:36:13.003622Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: !R,V#Fj8qi*P
[root@localhost ~]# mysql -uroot -p                              
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost ~]# mysql -uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log
2024-03-20T09:36:13.003622Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: !R,V#Fj8qi*P

!R,V#Fj8qi*P就是root密码

mysql -uroot -p

输入!R,V#Fj8qi*P

Change the root password as soon as possible by logging in with the generated, temporary password and set a custom password for the superuser account:

$> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root@098';

国内镜像安装

mirrors.ustc.edu.cn这个是中科大的镜像系统

下载如下rpm

mysql-community-client-8.0.36-1.el7.x86_64
mysql-community-common-8.0.36-1.el7.x86_64
mysql-community-libs-8.0.36-1.el7.x86_64
mysql-community-icu-data-files-8.0.36-1.el7.x86_64
mysql-community-libs-compat-8.0.36-1.el7.x86_64
mysql-community-client-plugins-8.0.36-1.el7.x86_64
mysql-community-server-8.0.36-1.el7.x86_64

如果用centos7去装MySQL5.7 还需要额外的安装3个包

libaio.x86_64  perl.x86_64 net-tools.x86_64 

到当前下载文件的目录下

yum install -y *.rpm就会安装下载的包了

systemctl start mysqld 启动mysql

systemctl enable mysqld 开机启动mysql

netstat -anpt 查看端口号

systemctl status mysqld 查看服务启动状态

mysql -uroot -p提示登录失败

解决方法

grep  “password” /var/log/mysqld.log

[root@localhost ~]# grep "password" /var/log/mysqld.log 
2024-03-20T09:36:13.003622Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: !R,V#Fj8qi*P
[root@localhost ~]# 

在root@localhost:后的内容为mysql的root密码

mysql》show databases;报错 提示需要改密码

#mysqladmin -uroot -p'!R,V#Fj8qi*P'  password 'Qianfeng@123'

有个小警告,

或者mysql>下使用

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

虚拟机环境这时可以做一个快照 名字为mysql安装后,后期操作混乱后可以恢复到次快照

1.rpm安装

2.源码安装

3自建mysql-yum仓库

--------------------------------------------------------------------------------------------------------------------------------

mysql忘记root密码

首先,去配置文件/etc/my.cnf):

【mysqld】

添加skip-grant-tables

重启mysql   systemctl restart mysqld

mysql -uroot -p  此时无密码

use mysql;

配置root密码为空

update user set authentication_string='' where user='root';

quit 退出

使用# 注销配置文件my.cnf的 skip-grant-tables

重启mysql systemctl restart mysqld

mysql -uroot 回车  无密码

ALTER user 'root'@'localhost' IDENTIFIED BY 'Root@098';

Root@098为新密码

为了保障,最好还是多创建一个超级特权用户:

CREATE USER '账号'@'%' IDENTIFIED BY '密码';

GRANT ALL PRIVILEGES ON *.* TO '账号'@'%' WITH GRANT OPTION;

最后刷新权限 flush privileges;

---------------------------------------------------------------------------------------------------------------------------------

数据库操作

建库:

mysql> create database discuz;
Query OK, 1 row affected (0.01 sec)

查看数据库:

show databases;

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| discuz             |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)
mysql> create database DISCUZ;
Query OK, 1 row affected (0.01 sec)mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| DISCUZ             |
| discuz             |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
6 rows in set (0.00 sec)mysql> 

注意:数据库的名字严格区分大小写

DISCUZ 和discuz是不同的数据库

mysql输入 “”回车“”不是执行和结束,结束需要用“;

数据库名字  不能用关键字、不能单独用数字和特殊字符、常用拼音和单词来定义。

使用某个数据库

USE +数据库名字

mysql> use discuz;
Database changed

mysql> select database();查看我在那个数据库中

mysql> select database();
+------------+
| database() |
+------------+
| discuz     |
+------------+
1 row in set (0.00 sec)mysql> 

删除数据库drop database +名字

mysql> drop database DISCUZ;
Query OK, 0 rows affected (0.01 sec)

数据库备份

确定目录

如果是源码安装,配置文件中的配置项 datadir=/usr/local/mysql/这个目录就是后期的数据库实体目录。

yum或者rpm安装的mysql的文件默认目录为/var/lib/mysql ,这个目录为数据库的实体文件目录,

[root@localhost ~]# cd /var/lib/mysql
[root@localhost mysql]# ls
auto.cnf       binlog.000004  ca-key.pem       discuz             ibdata1       mysql            performance_schema  server-key.pem
binlog.000001  binlog.000005  ca.pem           #ib_16384_0.dblwr  ibtmp1        mysql.ibd        private_key.pem     sys
binlog.000002  binlog.000006  client-cert.pem  #ib_16384_1.dblwr  #innodb_redo  mysql.sock       public_key.pem      undo_001
binlog.000003  binlog.index   client-key.pem   ib_buffer_pool     #innodb_temp  mysql.sock.lock  server-cert.pem     undo_002
[root@localhost mysql]# 

discuz目录就是我们创建的数据库。

创建表create tables 表名

create table t1 (id int);

mysql> create table t2 (id int);
Query OK, 0 rows affected (0.03 sec)mysql> 

表的描述说明 desc +表名

mysql> create table t2 (id int);
Query OK, 0 rows affected (0.03 sec)mysql> create table t3 (id int,name varchar(20));
Query OK, 0 rows affected (0.03 sec)mysql> desc t2;
+-------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------+------+-----+---------+-------+
| id    | int  | YES  |     | NULL    |       |
+-------+------+------+-----+---------+-------+
1 row in set (0.01 sec)mysql> desc t3;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id    | int         | YES  |     | NULL    |       |
| name  | varchar(20) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

默认值 default

key主键

null 可否为空

type 字段类型

extra 外键

表的数据插入及查询  select insert  

insert 字符需要用到双引号   例如"liuyang"

mysql> insert into t3 values (1,"liuyang");
Query OK, 1 row affected (0.02 sec)mysql> insert into t3 values (2,"wangyan");
Query OK, 1 row affected (0.01 sec)mysql> select * from t3;
+------+---------+
| id   | name    |
+------+---------+
|    1 | liuyang |
|    2 | wangyan |
+------+---------+
2 rows in set (0.00 sec)mysql> 

综合例子

mysql> create database school;
Query OK, 1 row affected (0.01 sec)mysql> use school;
Database changed
mysql> create table student1 (id int,-> name varchar(20),-> sex enum('m','f'),-> age int);
Query OK, 0 rows affected (0.09 sec)mysql> desc student1;
+-------+---------------+------+-----+---------+-------+
| Field | Type          | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| id    | int           | YES  |     | NULL    |       |
| name  | varchar(20)   | YES  |     | NULL    |       |
| sex   | enum('m','f') | YES  |     | NULL    |       |
| age   | int           | YES  |     | NULL    |       |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)mysql> insert into student1 values (1,'zhangsan','m',23);
Query OK, 1 row affected (0.01 sec)mysql> insert into student1 values (2,'lisi','f',22);
Query OK, 1 row affected (0.00 sec)mysql> insert into student1 values (3,'wangwu','v',22);
ERROR 1265 (01000): Data truncated for column 'sex' at row 1
mysql> insert into student1 values (3,'wangwu','m',22);
Query OK, 1 row affected (0.01 sec)mysql> select * from student1;
+------+----------+------+------+
| id   | name     | sex  | age  |
+------+----------+------+------+
|    1 | zhangsan | m    |   23 |
|    2 | lisi     | f    |   22 |
|    3 | wangwu   | m    |   22 |
+------+----------+------+------+
3 rows in set (0.00 sec)mysql> 

DQL查询

创造数据


mysql> create database haha;
Query OK, 1 row affected (0.01 sec)mysql> use haha;
Database changed
mysql> create table t3 (id int,name varchar(20),age int);
Query OK, 0 rows affected (0.03 sec)mysql> insert into t3 values values (1,'zhangsan',23);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values (1,'zhangsan',23)' at line 1
mysql> insert into t3 values (1,'zhangsan',23);
Query OK, 1 row affected (0.01 sec)mysql> insert into t3 values (2,'lisi',24);
Query OK, 1 row affected (0.00 sec)mysql> insert into t3 values (3,'wangwu',18);
Query OK, 1 row affected (0.00 sec)mysql> 

create

mysql> create database company;
Query OK, 1 row affected (0.01 sec)mysql> create table company.employee5(
id int primary key AUTO_INCREMENT not null,
name varchar(30) not null,
sex enum('male','female') default 'male' not null,
hire_date date not null,
post varchar(50) not null,
job_description varchar(100),
salary double(15,2) not null,
office int,
dep_id int);
mysql> desc company.employee5-> ;
+-----------------+-----------------------+------+-----+---------+----------------+
| Field           | Type                  | Null | Key | Default | Extra          |
+-----------------+-----------------------+------+-----+---------+----------------+
| id              | int                   | NO   | PRI | NULL    | auto_increment |
| name            | varchar(30)           | NO   |     | NULL    |                |
| sex             | enum('male','female') | NO   |     | male    |                |
| hire_date       | date                  | NO   |     | NULL    |                |
| job_description | varchar(100)          | YES  |     | NULL    |                |
| salary          | double(15,2)          | NO   |     | NULL    |                |
| office          | int                   | YES  |     | NULL    |                |
| dep_id          | int                   | YES  |     | NULL    |                |
+-----------------+-----------------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)mysql> 

insert

insert into company.employee5(name,sex,hire_date,post,job_description,salary,office,dep_id) values
('jack','male','20180202','instructor','teach',5000,501,100),
('tom','male','20180203','instructor','teach',5500,501,100),
('robin','male','20180202','instructor','teach',8000,501,100),
('alice','female','20180202','instructor','teach',7200,501,100),
('tianyun','male','20180202','hr','hrcc',600,502,101),
('harry','male','20180202','hr',NULL,6000,502,101),
('emma','female','20180206','sale','salecc',20000,503,102),
('christine','female','20180205','sale','salecc',2200,503,102),
('zhuzhu','male','20180205','sale',NULL,2200,503,102),
('gougou','male','20180205','sale','',2200,503,102);

select

mysql> select * from company.employee5;
+----+-----------+--------+------------+------------+-----------------+----------+--------+--------+
| id | name      | sex    | hire_date  | post       | job_description | salary   | office | dep_id |
+----+-----------+--------+------------+------------+-----------------+----------+--------+--------+
|  1 | jack      | male   | 2018-02-02 | instructor | teach           |  5000.00 |    501 |    100 |
|  2 | tom       | male   | 2018-02-03 | instructor | teach           |  5500.00 |    501 |    100 |
|  3 | robin     | male   | 2018-02-02 | instructor | teach           |  8000.00 |    501 |    100 |
|  4 | alice     | female | 2018-02-02 | instructor | teach           |  7200.00 |    501 |    100 |
|  5 | tianyun   | male   | 2018-02-02 | hr         | hrcc            |   600.00 |    502 |    101 |
|  6 | harry     | male   | 2018-02-02 | hr         | NULL            |  6000.00 |    502 |    101 |
|  7 | emma      | female | 2018-02-06 | sale       | salecc          | 20000.00 |    503 |    102 |
|  8 | christine | female | 2018-02-05 | sale       | salecc          |  2200.00 |    503 |    102 |
|  9 | zhuzhu    | male   | 2018-02-05 | sale       | NULL            |  2200.00 |    503 |    102 |
| 10 | gougou    | male   | 2018-02-05 | sale       |                 |  2200.00 |    503 |    102 |
+----+-----------+--------+------------+------------+-----------------+----------+--------+--------+
10 rows in set (0.00 sec)

select 排序

order by 

例如  +asc升序 默认

select name,salary from company.employee5 order by salary asc; 按照salary升序排列。

mysql> select name,salary from company.employee5 order by salary asc;
+-----------+----------+
| name      | salary   |
+-----------+----------+
| tianyun   |   600.00 |
| christine |  2200.00 |
| zhuzhu    |  2200.00 |
| gougou    |  2200.00 |
| jack      |  5000.00 |
| tom       |  5500.00 |
| harry     |  6000.00 |
| alice     |  7200.00 |
| robin     |  8000.00 |
| emma      | 20000.00 |
+-----------+----------+
10 rows in set (0.00 sec)

desc 降序

mysql> select name,salary from company.employee5 order by salary desc;
+-----------+----------+
| name      | salary   |
+-----------+----------+
| emma      | 20000.00 |
| robin     |  8000.00 |
| alice     |  7200.00 |
| harry     |  6000.00 |
| tom       |  5500.00 |
| jack      |  5000.00 |
| christine |  2200.00 |
| zhuzhu    |  2200.00 |
| gougou    |  2200.00 |
| tianyun   |   600.00 |
+-----------+----------+
10 rows in set (0.00 sec)

limit 3 限制,只输出3行

mysql> select name,salary from company.employee5 order by salary desc limit 4;
+-------+----------+
| name  | salary   |
+-------+----------+
| emma  | 20000.00 |
| robin |  8000.00 |
| alice |  7200.00 |
| harry |  6000.00 |
+-------+----------+
4 rows in set (0.00 sec)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/289118.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

JAVA虚拟机实战篇之GC调优[2](解决GC问题的手段)

文章目录 版权声明解决GC问题的手段优化基础JVM参数-Xmx 和 –Xms-XX:MaxMetaspaceSize 和 –XX:MetaspaceSize-Xss虚拟机栈大小‐XX:SurvivorRatio和‐XX:MaxTenuringThreshold-XX:DisableExplicitGC 案例:垃圾回收器的选择复习:垃圾回收器的组合关系背…

vue 元素拖动,复制,已复制元素可移动,快捷方便,已解决

注意:使用当前组件时,请先了解组件代码逻辑 下方组件根据自己的需求来更改响应的元素id,调整代码实现逻辑,这里不过多解释 import Vue from "vue";/*** 拖拽*/ Vue.directive("Drag", (el) > {const move…

MySQL表内容的增删查改

在前面几章的内容中我们学习了数据库的增删查改,表的增删查改,这一篇我们来学习一下对表中的内容做增删查改。 CRUD : Create(创建), Retrieve(读取),Update(更新),Delete(删除) 1.创建Create 我们先创建…

深入解析MD5哈希算法:原理、应用与安全性

码到三十五 : 个人主页 心中有诗画,指尖舞代码,目光览世界,步履越千山,人间尽值得 ! 本文将深入探讨MD5哈希算法的工作原理、应用场景以及安全性问题。我们将了解MD5如何生成固定长度的哈希值,以及它在数…

BUG未解之谜01-指针引用之谜

在leetcode里面刷题出现的问题,当我在sortedArrayToBST里面给root赋予初始值NULL之后,问题得到解决! 理论上root是未初始化的变量,然后我进入insert函数之后,root引用的内容也是未知值,因此无法给原来的二叉…

could not resolve com.android.tools.build:gradle:4.1.1.

一、报错信息 could not resolve com.android.tools.build:gradle:4.1.1.其实是因为你的网络不能从AS工程提供的mavenCentral()、google()和jcenter()等仓库下载相应的依赖。 二、解决方法 在build.gradle(Project)中,在原先的maven仓库前加上阿里云镜像源。这里…

如何遍历整个DOM树

原文链接:[如何遍历整个DOM树(外网原文链接)](https://chrisdeo.github.io/2019/07/20/%E5%A6%82%E4%BD%95%E9%81%8D%E5%8E%86%E6%95%B4%E4%B8%AADOM%E6%A0%91/) 作为前端开发工程师,我们大部分工作内容其实还是围绕着DOM在进行Javascript的编写&#xf…

SQL把统计结果作为条件进行查询

今天在社区看到一个问题如何返回 统计数值,比较简单,分享一下写法: --测试数据 if not object_id(NTempdb..#T) is nulldrop table #T Go Create table #T([name] nvarchar(21),[year] nvarchar(21),[time] nvarchar(22)) Insert #T select …

手写SpringBoot(二)之动态切换Servlet容器

系列文章目录 手写SpringBoot(一)之简易版SpringBoot 手写SpringBoot(二)之动态切换Servlet容器 手写SpringBoot(二)之动态切换Servlet容器 文章目录 系列文章目录手写SpringBoot(二&#xff…

KubeSphere简单介绍及安装使用

KubeSphere 概述 官网地址:https://kubesphere.io/zh/ 什么是 kubesphere KubeSphere 是一个开源的多云容器管理平台,旨在简化企业级 k8s 集群的部署、管理和运维。它提供了一个可视化的管理界面,帮助用户更轻松地管理和监控 k8s 集群&…

访问者模式(数据与行为解耦)

目录 前言 UML plantuml 类图 实战代码 SimpleFileVisitor FileVisitor 接口 删除指定文件夹 模板 IVisitor IVisitable Client 前言 一个类由成员变量和方法组成,成员变量即是类的数据结构,方法则是类的行为。 如果一个类的数据结构稳定&am…

超声波清洗机家用的哪家好?眼镜清洗器推荐!一分钟选购洗眼镜机

相信大家都知道,眼镜脏的话可以使用超声波清洗机清洁!因为超声波清洗机能够通过振频的原理,对眼镜的污垢进行清洗。有的朋友会问,我手洗不可以吗?手洗当然可以,但是手洗对于镜片的清洗有作用,但…

【C语言】 gets()puts()fgets()fputs()字符串输入输出函数的用法

文章目录 C语言中的字符串输入输出函数:gets、puts、fgets与fputsgets函数puts函数fgets函数fputs函数 C语言中的字符串输入输出函数知识点总结结语 C语言中的字符串输入输出函数:gets、puts、fgets与fputs 在C语言中,处理字符串的输入和输出…

Java关键字之 assert

语法 assert关键字语法有两种用法&#xff1a; 1、assert <boolean表达式> 如果<boolean表达式>为true&#xff0c;则程序继续执行。 如果为false&#xff0c;则程序抛出AssertionError&#xff0c;并终止执行。 2、assert <boolean表达式> : <错误信…

翔云身份证实名认证接口-PHP调用方法

网络平台集成实名认证接口&#xff0c;是顺应当下网络实名制规定&#xff0c;有效规避法律风险。互联网平台若没有实名认证功能&#xff0c;那么便无法保证网民用户身份的真实性&#xff0c;很有可能被虚假用户攻击&#xff0c;特别是在当网络平台产生垃圾信息乃至是违法信息时…

必示科技携手云杉网络发布“智能可观测性联合解决方案”

近日&#xff0c;必示科技与云杉网络携手发布“智能可观测性联合解决方案”&#xff0c;整体方案融合云杉网络DeepFlow产品在可观测性领域、必示科技AIOps产品在运维数据分析领域的深厚技术积淀&#xff0c;完整实现IT系统高质量、高性能、全栈的可观测数据采集、智能监控和智能…

Go —— defer

defer defer 语句用于延迟函数的调用&#xff0c;常用于关闭文件描述符、释放锁等资源释放场景。但 defer 关键字只能作用于函数或函数调用。 defer func(){ // 函数fmt.Print("Hello&#xff0c;World!") }()defer fmt.Print("Hello&#xff0c;World!&…

第十三届国际纯数学与应用数学会议(ICPAM 2024)即将召开!

第十三届国际纯数学与应用数学会议将于2024年7月17日至20日在克罗地亚萨格勒布召开。ICPAM是一项连续成功举办十二年的年度会议&#xff0c;其汇集了纯数学和应用数学领域的教授、研究人员、学者和学生&#xff0c;为跨行业交流&#xff0c;经验分享&#xff0c;学术界合作以及…

ArcGIS Pro横向水平图例

终于知道ArcGIS Pro怎么调横向图例了&#xff01; 简单的像0一样 旋转&#xff0c;左转右转随便转 然后调整图例项间距就可以了&#xff0c;参数太多就随便试&#xff0c;总有一款适合你&#xff01; 要调整长度&#xff0c;就调整图例块的大小。完美&#xff01; 好不容易…

【C++】手撕哈希表的闭散列和开散列

> 作者&#xff1a;დ旧言~ > 座右铭&#xff1a;松树千年终是朽&#xff0c;槿花一日自为荣。 > 目标&#xff1a;手撕哈希表的闭散列和开散列 > 毒鸡汤&#xff1a;谁不是一边受伤&#xff0c;一边学会坚强。 > 专栏选自&#xff1a;C嘎嘎进阶 > 望小伙伴们…