下载yum源

官网地址:http://dev.mysql.com/downloads/repo/yum/

centos7系统:

http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm

# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

[root@localhost ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
---- ::-- https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:... connected.
HTTP request sent, awaiting response... Found
Location: https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm [following]
---- ::-- https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 104.74.21.42
Connecting to repo.mysql.com (repo.mysql.com)|104.74.21.42|:... connected.
HTTP request sent, awaiting response... OK
Length: (25K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-.noarch.rpm’ %[===================================================================================================================>] , --.-K/s in .1s -- :: ( KB/s) - ‘mysql57-community-release-el7-.noarch.rpm’ saved [/] [root@localhost ~]# ls
anaconda-ks.cfg mysql57-community-release-el7-.noarch.rpm

检测系统是否自带安装mysql

# yum list installed | grep mysql

删除系统自带的mysql

# yum -y remove mysql-libs.x86_64

这个mysql的yum源服务器在国外,所以下载速度会比较慢,mysql5.6只有79M大,而mysql5.7就有182M。

安装mysql57-community-release-el7-11.noarch.rpm包

# yum -y install mysql57-community-release-el7-11.noarch.rpm

[root@localhost ~]# yum -y install mysql57-community-release-el7-.noarch.rpm
Loaded plugins: fastestmirror
Examining mysql57-community-release-el7-.noarch.rpm: mysql57-community-release-el7-.noarch
Marking mysql57-community-release-el7-.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch :el7- will be installed
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
mysql57-community-release noarch el7- /mysql57-community-release-el7-.noarch k Transaction Summary
=============================================================================================================================================================
Install Package Total size: k
Installed size: k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql57-community-release-el7-.noarch /
Verifying : mysql57-community-release-el7-.noarch / Installed:
mysql57-community-release.noarch :el7- Complete!

安装完这个包后,会获得两个mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo

[root@localhost ~]# ls /etc/yum.repos.d/
centos.repo mysql-community.repo mysql-community-source.repo

# cat /etc/yum.repos.d/mysql-community.repo

[root@localhost ~]# cat /etc/yum.repos.d/mysql-community.repo
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/$basearch/
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# cat /etc/yum.repos.d/mysql-community-source.repo

[root@localhost ~]# cat /etc/yum.repos.d/mysql-community-source.repo
[mysql-connectors-community-source]
name=MySQL Connectors Community - Source
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community-source]
name=MySQL Tools Community - Source
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql55-community-source]
name=MySQL 5.5 Community Server - Source
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql56-community-source]
name=MySQL 5.6 Community Server - Source
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql57-community-source]
name=MySQL 5.7 Community Server - Source
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql80-community-source]
name=MySQL 8.0 Community Server - Source
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview-source]
name=MySQL Tools Preview - Source
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.5-community-source]
name=MySQL Cluster 7.5 Community - Source
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.6-community-source]
name=MySQL Cluster 7.6 Community - Source
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/SRPMS
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

用yum repolist mysql这个命令查看一下是否已经有mysql可安装文件

# yum repolist all | grep mysql

[root@localhost ~]# yum repolist all | grep mysql
mysql-cluster-7.5-community/x86_64 MySQL Cluster 7.5 Community disabled
mysql-cluster-7.5-community-source MySQL Cluster 7.5 Community - disabled
mysql-cluster-7.6-community/x86_64 MySQL Cluster 7.6 Community disabled
mysql-cluster-7.6-community-source MySQL Cluster 7.6 Community - disabled
mysql-connectors-community/x86_64 MySQL Connectors Community enabled:
mysql-connectors-community-source MySQL Connectors Community - disabled
mysql-tools-community/x86_64 MySQL Tools Community enabled:
mysql-tools-community-source MySQL Tools Community - Sourc disabled
mysql-tools-preview/x86_64 MySQL Tools Preview disabled
mysql-tools-preview-source MySQL Tools Preview - Source disabled
mysql55-community/x86_64 MySQL 5.5 Community Server disabled
mysql55-community-source MySQL 5.5 Community Server - disabled
mysql56-community/x86_64 MySQL 5.6 Community Server disabled
mysql56-community-source MySQL 5.6 Community Server - disabled
mysql57-community/x86_64 MySQL 5.7 Community Server enabled:
mysql57-community-source MySQL 5.7 Community Server - disabled
mysql80-community/x86_64 MySQL 8.0 Community Server disabled
mysql80-community-source MySQL 8.0 Community Server - disabled

安装mysql

# yum install mysql-server -y

比较慢,耐心等待

Installed:
mysql-community-libs.x86_64 :5.7.-.el7 mysql-community-libs-compat.x86_64 :5.7.-.el7 mysql-community-server.x86_64 :5.7.-.el7 Dependency Installed:
mysql-community-client.x86_64 :5.7.-.el7 mysql-community-common.x86_64 :5.7.-.el7 net-tools.x86_64 :2.0-0.24.20131004git.el7 Dependency Updated:
openssl.x86_64 :1.0.2k-.el7_6. openssl-libs.x86_64 :1.0.2k-.el7_6. postfix.x86_64 :2.10.-.el7 Replaced:
mariadb-libs.x86_64 :5.5.-.el7.centos Complete!

安装mysql指定版本,例如安装mysql5.7.22版

# yum install mysql-community-server-5.7.22 -y

下载rpm安装包到/opt/pages

# yum install --downloadonly --downloaddir=/opt/pages mysql-community-server-5.7.22

加入开机自启动

# systemctl enable mysqld

启动mysql服务进程

# systemctl start mysqld

查看mysql服务进程

# systemctl status mysqld

[root@localhost ~]# systemctl start mysqld
[root@localhost ~]#
[root@localhost ~]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Sat -- :: CST; 7s ago
Docs: man:mysqld()
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=/SUCCESS)
Process: ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=/SUCCESS)
Main PID: (mysqld)
CGroup: /system.slice/mysqld.service
└─ /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid Aug :: localhost.localdomain systemd[]: Starting MySQL Server...
Aug :: localhost.localdomain systemd[]: Started MySQL Server.

进入mysql

# mysql

[root@localhost ~]# mysql
ERROR (): Access denied for user 'root'@'localhost' (using password: NO)

MySQL服务器初始化(从MySQL 5.7开始):在服务器初始启动时,如果服务器的数据目录为空,则会发生以下情况:

(1)、服务器已初始化

(2)、在数据目录中生成SSL证书和密钥文件

(3)、该validate_password插件安装并启用

(4)、将'root'@'localhost' 创建一个超级用户帐户。设置超级用户的密码并将其存储在日志文件中。要显示它,请使用以下命令:

# grep "password" /var/log/mysqld.log

[root@localhost ~]# grep "password" /var/log/mysqld.log
--10T14::.529782Z [Note] A temporary password is generated for root@localhost: #&kdOvHin6gP
--10T14::.145451Z [Note] Access denied for user 'root'@'localhost' (using password: NO)

使用用户名密码进入mysql

[root@localhost ~]# mysql -uroot -p
Enter password: #输入初始密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>

输入初始密码进入mysql数据库,此时不能做任何事情,因为MySQL默认必须修改密码之后才能操作数据库

mysql> show databases;
ERROR (HY000): You must reset your password using ALTER USER statement before executing this statement

修改mysql密码

注意:
MySQL的 validate_password 插件默认安装。这将要求密码包含至少一个大写字母,一个小写字母,一个数字和一个特殊字符,并且密码总长度至少为8个字符。

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
ERROR (HY000): Your password does not satisfy the current policy requirements

mysql> SET PASSWORD = PASSWORD('Admin123!');

mysql> SET PASSWORD = PASSWORD('Admin123!');
Query OK, rows affected, warning (0.00 sec)

MySQL完整的初始密码规则可以通过如下命令查看:

mysql> SHOW VARIABLES LIKE 'validate_password%';

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | |
| validate_password_mixed_case_count | |
| validate_password_number_count | |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | |
+--------------------------------------+--------+
rows in set (0.01 sec)

密码的长度是由validate_password_length决定的,而validate_password_length的计算公式是:

validate_password_length = validate_password_number_count + validate_password_special_char_count + ( * validate_password_mixed_case_count)

如果只想设置简单密码需要修改两个全局参数:

mysql> set global validate_password_policy=0;

mysql> set global validate_password_length=1;

mysql> set global validate_password_policy=;
Query OK, rows affected (0.00 sec) mysql> set global validate_password_length=;
Query OK, rows affected (0.00 sec)

再次查看mysql密码规则

mysql> SHOW VARIABLES LIKE 'validate_password%';

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | |
| validate_password_mixed_case_count | |
| validate_password_number_count | |
| validate_password_policy | LOW |
| validate_password_special_char_count | |
+--------------------------------------+-------+
rows in set (0.00 sec)

此时密码就可以设置的很简单,例如1234之类的

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
Query OK, rows affected (0.00 sec)

设置远程可以登录

授权远程登录

grant all privileges on *.* to root@'%' identified by 'password' with grant option;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;

第一个是你的用户名root,第二个password是远程的密码

mysql> grant all privileges on *.* to root@'%' identified by '123456' with grant option

flush命令使配置立即生效

mysql> flush privileges;

mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
rows in set (0.00 sec) mysql> grant all privileges on *.* to root@'%' identified by '' with grant option;
Query OK, rows affected, warning (0.01 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec) mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| root | % |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
rows in set (0.00 sec)

或者使用一下语句修改授权远程客户端登录

use mysql;

show tables;

select Host,User from user \G

update user set host = '%' where Host = "localhost" and user = "root";

修改一些简单的配置:

默认的字符集是拉丁字符集,每次创建数据库的时候要设置字符集;默认还不支持group by语句,默认的时区也不是我们现在的北京时间(东八区),会导致我们的时间差了13个点。

打开配置文件,yum安装的默认在/etc文件夹下:/etc/my.cnf

# vi /etc/my.cnf

默认配置如下:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at % of total RAM for dedicated server, else %.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links= log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

在[mysqld]下面添加,不需要分号

字符集:注意是utf8而不是utf-8!

character-set-server=utf8

查看mysql字符集

mysql> show variables like 'char%';

默认字符集如下

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
rows in set (0.00 sec)

设置时区为东八区

default-time_zone = '+8:00'

sql支持group by语句

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

附yum安装源:

centos7_mysql5.7.repo

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/x86_64/
enabled=
gpgcheck= [mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/x86_64/
enabled=
gpgcheck= [mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/
enabled=
gpgcheck=

参考博客:

CentOS7 yum方式安装MySQL5.7

centos7.4安装MySQL5.7

https://blog.csdn.net/pzl_pzl/article/details/82015144

centos7下使用yum源安装mysql5.7记录

https://www.jianshu.com/p/531cc35b15e7

CentOS7安装MySQL

centos7使用MySQL的Yum存储库安装mysql5.7.27的更多相关文章

  1. centos7使用MySQL的Yum存储库安装mysql5.6.45

    注意:这个MySQL5.6.45版本有问题,修改配置文件不生效,推荐安装MySQL5.6.43 下载yum源 官网地址:http://dev.mysql.com/downloads/repo/yum/ ...

  2. MySQL Yum存储库 安装、升级、集群

    添加MySQL Yum存储库 首先,将MySQL Yum存储库添加到系统的存储库列表中.按着这些次序: 在http://dev.mysql.com/downloads/repo/yum/上转到MySQ ...

  3. 使用MySQL Yum存储库的快速指南【mysql官方文档】

    使用MySQL Yum存储库的快速指南 抽象 MySQL Yum存储库提供用于在Linux平台上安装MySQL服务器,客户端和其他组件的RPM包.这些软件包还可以升级和替换从Linux发行版本机软件存 ...

  4. CentOS设置yum存储库 (nginx)

    要为RHEL / CentOS设置yum存储库,请创建/etc/yum.repos.d/nginx.repo 使用以下内容命名的文件 : [nginx] name=nginx repo baseurl ...

  5. Linux系统 Centos7/Centos6.8 yum命令在线安装 MySQL5.6

    Linux系统 Centos7 yum命令在线安装 MySQL5.6 标签: centosmysqlyum 2015-11-18 17:21 707人阅读 评论(0) 收藏 举报  分类: Linux ...

  6. Centos7安装mysql缺乏yum源怎么安装

    找到mysql5.6的centos的repo源,终于解决mysql的安装问题: 1.确保centos安装了wget,没有的话安装wget   1 yum install wget 2.下载mysql的 ...

  7. RHEL8 创建本地YUM存储库

    yum 的好处及本地yum的好处不在本文讨论范畴,本文针对rhel8中的新功能yum做简要介绍和配置,在 RHEL 8中分为两个存储库: BaseOS 应用程序流(AppStream) BaseOS中 ...

  8. centos7和centos6.5环境rpm方式安装mysql5.7和mysql5.6详解

    centos环境安装mysql5.7 其实不建议安装mysql5.7 语法和配置可能和以前的版本区别较大,多坑,慎入 1.yum方式安装(不推荐) a.安装mysql5.7 yum源 centos6: ...

  9. Centos7系统下以RPM方式如何安装mysql-5.7

    检查系统是否装有mariadb rpm -qa | grep mariadb 卸载mariadb 强制卸载mariadb rpm -e --nodeps mariadb-libs-5.5.35-3.e ...

随机推荐

  1. Mysql.linux登录数据库

    //mysql -hlocalhost -uroot -p //-h数据库地址 -u用户名 -p密码 -P端口号(P大写)//-p可省略,会提示输入密码. mysql -h127. -uroot -p ...

  2. 【javaWeb】HttpServletRequest常用获取URL的方法

    1.request.getRequestURL() 返回的是完整的url,包括Http协议,端口号,servlet名字和映射路径,但它不包含请求参数. 2.request.getRequestURI( ...

  3. python,for循环的使用案例集

    1.循环执行某一系列操作.将该操作定义为一个def,然后使用for去循环执行该操作 思路,先把操作定义为一个函数,在for循环执行这个函数 比如下面案例,把微信好友列表内的好友,循环的方式依次调整到第 ...

  4. Python学习初级python3.6的安装配置

    首先我们来安装python 1.首先进入网站下载:点击打开链接(或自己输入网址https://www.python.org/downloads/),进入之后如下图,选择图中红色圈中区域进行下载. 2. ...

  5. excle 写入数据库

    龙龙博客:https://www.cnblogs.com/meilong/p/cao-zuoexcel-mo-kuaiopenpyxl.html 1 安装 pip install openpyxl 如 ...

  6. crtmpserver服务器的搭建

    https://blog.csdn.net/wutong_login/article/details/7612477 https://www.cnblogs.com/wangqiguo/p/60145 ...

  7. Python中__init__的用法和理解

    在Python中定义类经常会用到__init__函数(方法),首先需要理解的是,两个下划线开头的函数是声明该属性为私有,不能在类的外部被使用或访问.而__init__函数(方法)支持带参数类的初始化, ...

  8. CSS学习笔记--Div+Css布局(div+span以及盒模型)

    1.DIV与SPAN 1.1简介 1.DIV和SPAN在整个HTML标记中,没有任何意义,他们的存在就是为了应用CSS样式 2.DIV和span的区别在与,span是内联元素,div是块级元素 内联元 ...

  9. .net core3.1 下由Autofac接管IOC

    我们都知道,.net core天生自带IOC容器,但是他的功能其实并不强大,而且有坑:在构造注入的时候,他默认找参数最少的构造函数. 这里,我讲解如何使用Autofac去接管IOC,至于为什么要选Au ...

  10. 2.OpenStack 网络简介(neutron)

    OpenStack 网络简介(neutron) 概述和组件 OpenStack 网络允许您创建和管理网络对象, 如网络.子网和端口, 其他 OpenStack 服务可以使用.插件可以实现, 以适应不同 ...