YUM方式安裝MYSQL5.7

来源:https://www.cnblogs.com/yongestcat/archive/2019/08/14/11349723.html
-Advertisement-
Play Games

首先mysql官網下載yum源https://dev.mysql.com/downloads/repo/yum/然後將下載好的rpm文件安裝並校驗[root@elegant-snap-3 /stage]$ rpm -ivh mysql80-community-release-el7-2.noarch... ...


首先mysql官網下載yum源https://dev.mysql.com/downloads/repo/yum/

image然後將下載好的rpm文件安裝並校驗


[root@elegant-snap-3 /stage]$ rpm -ivh mysql80-community-release-el7-2.noarch.rpm 
warning: mysql80-community-release-el7-2.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql80-community-release-el7-2  ################################# [100%]
[root@elegant-snap-3 /stage]$ ls /etc/yum.repos.d/ 
CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-Vault.repo  epel-testing.repo            vscode.repo
CentOS-CR.repo         CentOS-Media.repo      elrepo.repo        mysql-community.repo
CentOS-Debuginfo.repo  CentOS-Sources.repo    epel.repo          mysql-community-source.repo
[root@elegant-snap-3 /stage]$ yum list|grep mysql
mysql80-community-release.noarch            el7-2                      installed
akonadi-mysql.x86_64                        1.9.2-4.el7                base     
apr-util-mysql.x86_64                       1.5.2-6.el7                base     
dovecot-mysql.x86_64                        1:2.2.36-3.el7             base     
freeradius-mysql.x86_64                     3.0.13-9.el7_5             base     
libdbi-dbd-mysql.x86_64                     0.8.3-16.el7               base     
mysql-community-client.i686                 8.0.15-1.el7               mysql80-community
mysql-community-client.x86_64               8.0.15-1.el7               mysql80-community
mysql-community-common.i686                 8.0.15-1.el7               mysql80-community
mysql-community-common.x86_64               8.0.15-1.el7               mysql80-community
mysql-community-devel.i686                  8.0.15-1.el7               mysql80-community
mysql-community-devel.x86_64                8.0.15-1.el7               mysql80-community
mysql-community-embedded-compat.i686        8.0.15-1.el7               mysql80-community
mysql-community-embedded-compat.x86_64      8.0.15-1.el7               mysql80-community
mysql-community-libs.i686                   8.0.15-1.el7               mysql80-community
mysql-community-libs.x86_64                 8.0.15-1.el7               mysql80-community
mysql-community-libs-compat.i686            8.0.15-1.el7               mysql80-community
mysql-community-libs-compat.x86_64          8.0.15-1.el7               mysql80-community
mysql-community-release.noarch              el7-5                      mysql-connectors-community
mysql-community-server.x86_64               8.0.15-1.el7               mysql80-community
mysql-community-test.x86_64                 8.0.15-1.el7               mysql80-community
mysql-connector-c++.x86_64                  8.0.15-1.el7               mysql-connectors-community
mysql-connector-c++-devel.x86_64            8.0.15-1.el7               mysql-connectors-community
mysql-connector-c++-jdbc.x86_64             8.0.15-1.el7               mysql-connectors-community
mysql-connector-java.noarch                 1:5.1.25-3.el7             base     
mysql-connector-odbc.x86_64                 8.0.15-1.el7               mysql-connectors-community
mysql-connector-odbc-debuginfo.x86_64       8.0.15-1.el7               mysql-connectors-community
mysql-connector-odbc-setup.x86_64           8.0.15-1.el7               mysql-connectors-community
mysql-connector-python.noarch               2.0.4-1.el7                mysql-connectors-community
mysql-connector-python.x86_64               8.0.15-1.el7               mysql-connectors-community
mysql-connector-python-cext.x86_64          8.0.15-1.el7               mysql-connectors-community
mysql-connector-python-debuginfo.x86_64     2.1.7-1.el7                mysql-connectors-community
mysql-ref-manual-8.0-en-html-chapter.noarch 1-20190127                 mysql80-community
mysql-ref-manual-8.0-en-pdf.noarch          1-20190127                 mysql80-community
mysql-router.x86_64                         8.0.12-1.el7               mysql-tools-community
mysql-router-community.x86_64               8.0.15-1.el7               mysql-tools-community
mysql-router-debuginfo.x86_64               8.0.12-1.el7               mysql-tools-community
mysql-shell.x86_64                          8.0.15-1.el7               mysql-tools-community
mysql-shell-debuginfo.x86_64                8.0.15-1.el7               mysql-tools-community
mysql-utilities.noarch                      1.6.5-1.el7                mysql-tools-community
mysql-utilities-extra.noarch                1.5.6-1.el7                mysql-tools-community
mysql-workbench-community.x86_64            8.0.15-1.el7               mysql-tools-community
mysql-workbench-community-debuginfo.x86_64  8.0.15-1.el7               mysql-tools-community
pcp-pmda-mysql.x86_64                       4.1.0-5.el7_6              updates  
php-mysql.x86_64                            5.4.16-46.el7              base     
php-mysqlnd.x86_64                          5.4.16-46.el7              base     
qt-mysql.i686                               1:4.8.7-2.el7              base     
qt-mysql.x86_64                             1:4.8.7-2.el7              base     
qt5-qtbase-mysql.i686                       5.9.2-3.el7                base     
qt5-qtbase-mysql.x86_64                     5.9.2-3.el7                base     
redland-mysql.x86_64                        1.0.16-6.el7               base     
rsyslog-mysql.x86_64                        8.24.0-34.el7              base     
[root@elegant-snap-3 /stage]$ 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:       95
mysql-connectors-community-source  MySQL Connectors Community  disabled
mysql-tools-community/x86_64       MySQL Tools Community       enabled:       84
mysql-tools-community-source       MySQL Tools Community - Sou disabled
mysql-tools-preview/x86_64         MySQL Tools Preview         disabled
mysql-tools-preview-source         MySQL Tools Preview - Sourc 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  disabled
mysql57-community-source           MySQL 5.7 Community Server  disabled
mysql80-community/x86_64           MySQL 8.0 Community Server  enabled:       82
mysql80-community-source           MySQL 8.0 Community Server  disabled
[root@elegant-snap-3 /stage]$ 

預設是最新的mysql8.0源啟用,修改為5.7啟用8.0禁用

image

[root@elegant-snap-3 /etc/yum.repos.d]$ 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:       95
mysql-connectors-community-source  MySQL Connectors Community  disabled
mysql-tools-community/x86_64       MySQL Tools Community       enabled:       84
mysql-tools-community-source       MySQL Tools Community - Sou disabled
mysql-tools-preview/x86_64         MySQL Tools Preview         disabled
mysql-tools-preview-source         MySQL Tools Preview - Sourc 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:      327
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
[root@elegant-snap-3 /etc/yum.repos.d]$ 

那麼mysql5.7的yum源就設置好了直接yum install

[root@elegant-snap-3 /etc/yum.repos.d]$ yum install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: repos.lax.quadranet.com
 * elrepo-kernel: repos.lax-noc.com
 * extras: repos.lax.quadranet.com
 * updates: mirror.fileplanet.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.25-1.el7 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package mysql-community-client.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.25-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.25-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.25-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.25-1.el7 will be obsoleting
---> Package postfix.x86_64 2:2.10.1-6.el7 will be updated
---> Package postfix.x86_64 2:2.10.1-7.el7 will be an update
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: 2:postfix-2.10.1-7.el7.x86_64
--> Running transaction check
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-60.el7 for package: 1:openssl-1.0.1e-60.el7.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-16.el7_6.1 will be an update
--> Running transaction check
---> Package openssl.x86_64 1:1.0.1e-60.el7 will be updated
---> Package openssl.x86_64 1:1.0.2k-16.el7_6.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                                 Arch               Version                            Repository                     Size
===================================================================================================================================
Installing:
 mysql-community-libs                    x86_64             5.7.25-1.el7                       mysql57-community             2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7
 mysql-community-libs-compat             x86_64             5.7.25-1.el7                       mysql57-community             2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7
 mysql-community-server                  x86_64             5.7.25-1.el7                       mysql57-community             165 M
Installing for dependencies:
 libaio                                  x86_64             0.3.109-13.el7                     base                           24 k
 mysql-community-client                  x86_64             5.7.25-1.el7                       mysql57-community              24 M
 mysql-community-common                  x86_64             5.7.25-1.el7                       mysql57-community             274 k
Updating for dependencies:
 openssl                                 x86_64             1:1.0.2k-16.el7_6.1                updates                       493 k
 openssl-libs                            x86_64             1:1.0.2k-16.el7_6.1                updates                       1.2 M
 postfix                                 x86_64             2:2.10.1-7.el7                     base                          2.4 M

Transaction Summary
===================================================================================================================================
Install  3 Packages (+3 Dependent packages)
Upgrade             ( 3 Dependent packages)

Total download size: 198 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): libaio-0.3.109-13.el7.x86_64.rpm                                                                     |  24 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.25-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.7.25-1.el7.x86_64.rpm is not installed
(2/9): mysql-community-common-5.7.25-1.el7.x86_64.rpm                                                       | 274 kB  00:00:00     
(3/9): mysql-community-libs-5.7.25-1.el7.x86_64.rpm                                                         | 2.2 MB  00:00:00     
(4/9): mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm                                                  | 2.0 MB  00:00:00     
(5/9): mysql-community-client-5.7.25-1.el7.x86_64.rpm                                                       |  24 MB  00:00:00     
(6/9): postfix-2.10.1-7.el7.x86_64.rpm                                                                      | 2.4 MB  00:00:00     
(7/9): openssl-1.0.2k-16.el7_6.1.x86_64.rpm                                                                 | 493 kB  00:00:00     
(8/9): openssl-libs-1.0.2k-16.el7_6.1.x86_64.rpm                                                            | 1.2 MB  00:00:00     
(9/9): mysql-community-server-5.7.25-1.el7.x86_64.rpm                                                       | 165 MB  00:00:03     
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               54 MB/s | 198 MB  00:00:03     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering   @oss.oracle.com="">"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql80-community-release-el7-2.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                        1/13 
  Installing : mysql-community-common-5.7.25-1.el7.x86_64                                                                     2/13 
  Installing : mysql-community-libs-5.7.25-1.el7.x86_64                                                                       3/13 
  Installing : mysql-community-libs-compat-5.7.25-1.el7.x86_64                                                                4/13 
  Installing : mysql-community-client-5.7.25-1.el7.x86_64                                                                     5/13 
  Installing : libaio-0.3.109-13.el7.x86_64                                                                                   6/13 
  Installing : mysql-community-server-5.7.25-1.el7.x86_64                                                                     7/13 
  Updating   : 2:postfix-2.10.1-7.el7.x86_64                                                                                  8/13 
  Updating   : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                             9/13 
  Cleanup    : 2:postfix-2.10.1-6.el7.x86_64                                                                                 10/13 
  Erasing    : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                            11/13 
  Cleanup    : 1:openssl-1.0.1e-60.el7.x86_64                                                                                12/13 
  Cleanup    : 1:openssl-libs-1.0.1e-60.el7.x86_64                                                                           13/13 
  Verifying  : mysql-community-libs-5.7.25-1.el7.x86_64                                                                       1/13 
  Verifying  : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                             2/13 
  Verifying  : mysql-community-libs-compat-5.7.25-1.el7.x86_64                                                                3/13 
  Verifying  : mysql-community-common-5.7.25-1.el7.x86_64                                                                     4/13 
  Verifying  : 2:postfix-2.10.1-7.el7.x86_64                                                                                  5/13 
  Verifying  : mysql-community-client-5.7.25-1.el7.x86_64                                                                     6/13 
  Verifying  : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                        7/13 
  Verifying  : mysql-community-server-5.7.25-1.el7.x86_64                                                                     8/13 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                   9/13 
  Verifying  : 1:openssl-libs-1.0.1e-60.el7.x86_64                                                                           10/13 
  Verifying  : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                            11/13 
  Verifying  : 2:postfix-2.10.1-6.el7.x86_64                                                                                 12/13 
  Verifying  : 1:openssl-1.0.1e-60.el7.x86_64                                                                                13/13 

Installed:
  mysql-community-libs.x86_64 0:5.7.25-1.el7                    mysql-community-libs-compat.x86_64 0:5.7.25-1.el7                 
  mysql-community-server.x86_64 0:5.7.25-1.el7                 

Dependency Installed:
  libaio.x86_64 0:0.3.109-13.el7    mysql-community-client.x86_64 0:5.7.25-1.el7    mysql-community-common.x86_64 0:5.7.25-1.el7   

Dependency Updated:
  openssl.x86_64 1:1.0.2k-16.el7_6.1         openssl-libs.x86_64 1:1.0.2k-16.el7_6.1         postfix.x86_64 2:2.10.1-7.el7        

Replaced:
  mariadb-libs.x86_64 1:5.5.52-1.el7                                                                                               

Complete!

啟動mysql

[root@elegant-snap-3 /etc/yum.repos.d]$ systemctl start mysqld.service
[root@elegant-snap-3 /etc/yum.repos.d]$ systemctl status mysqld.service
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-04-20 22:48:51 EDT; 3s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 29727 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 29709 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 29730 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─29730 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Apr 20 22:48:50 elegant-snap-3.localdomain systemd[1]: Starting MySQL Server...
Apr 20 22:48:51 elegant-snap-3.localdomain systemd[1]: Started MySQL Server.
[root@elegant-snap-3 /etc/yum.repos.d]$ 

從日誌文件獲取臨時密碼並改密碼,由於測試環境密碼設置簡單不通過密碼複雜度要修改下密碼策略

image

[root@elegant-snap-3 /etc/yum.repos.d]$ grep 'temporary password' /var/log/mysqld.log 
2019-04-21T02:45:29.945179Z 1 [Note] A temporary password is generated for root@localhost: uxEQfR:,i4lp
[root@elegant-snap-3 /etc/yum.repos.d]$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25

Copyright (c) 2000, 2019, 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> alter user 'root'@'localhost' identified by 'mysql';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> set global validate_password_length=4;
Query OK, 0 rows affected (0.00 sec)

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

mysql> set password=password('mysql');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye
[root@elegant-snap-3 /etc/yum.repos.d]$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> 

then ojbk,have fun!


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1、淘汰簡介 Redis官方給的警告,當記憶體不足時,Redis會根據配置的緩存策略淘汰部分keys,以保證寫入成功。當無淘汰策略時或沒有找到適合淘汰的key時,Redis直接返回out of memory錯誤。 2、最大緩存配置 在redis中,允許用戶設置的最大使用記憶體大小是 512G。 在 re ...
  • 轉載、節選於https://dev.mysql.com/doc/refman/8.0/en/innodb-tables.html 1.InnoDB Architecture The following diagram shows in-memory and on-disk structures th ...
  • DBUtils是JDBC的簡化開發工具包。需要導入commons-dbutils-1.6.jar才能夠正常使用DBUtils工具。 1、DBUtils功能簡介 1.QueryRunner中提供對SQL語句操作的API 2.ResultSetHandler介面,用於定義select操作後,怎樣封裝結果 ...
  • 1、簡介 Redis 事務可以一次執行多個命令, 並且帶有以下三個重要的保證: 批量操作在發送 EXEC 命令前被放入隊列緩存。 收到 EXEC 命令後進入事務執行,事務中任意命令執行失敗,其餘的命令依然被執行。 在事務執行過程,其他客戶端提交的命令請求不會插入到事務執行命令序列中。 一個事務從開始 ...
  • 08.14自我總結 資料庫的備份 一資料庫的備份 1.單庫備份 2.多庫備份 3.備份所有庫 二.備份恢復 1.退出資料庫後 多庫 3.使用gzip進行壓縮數據備份 4.備份時候切割binlog日誌:(進行增量備份的時候可以用到) 5.備份的時候會記錄指定文件的位置以及mysqlbinglog的文件 ...
  • 1.1 zookeeper(分散式協作服務) ZooKeeper是一個分散式的,開放源碼的分散式應用程式協調服務,是Google的Chubby一個開源的實現,它是集群的管理者,監視著集群中各個節點的狀態根據節點提交的反饋進行下一步合理操作。最終,將簡單易用的介面和性能高效、功能穩定的系統提供給用戶。 ...
  • 作者:呼延十 juejin.im/post/5d351303f265da1bd30596f9 前言 本文主要受眾為開發人員,所以不涉及到MySQL的服務部署等操作,且內容較多,大家準備好耐心和瓜子礦泉水. 前一陣系統的學習了一下MySQL,也有一些實際操作經驗,偶然看到一篇和MySQL相關的面試文章 ...
  • 簡單的一個sql表遍歷 一般我們寫儲存過程或者其他sql語句的時候都會用到迴圈遍曆數據,最常用的兩種就是 1、游標 2、臨時表+while 下麵貼出示例代碼 這中找最小值遍歷的方式,代碼較簡潔,我比較喜歡用這種,就是不知道這種和其他兩種對比 有什麼缺點,還望各位大佬們指點。 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...