centos 6.9安裝mysql

来源:http://www.cnblogs.com/huanongying/archive/2017/07/06/7124246.html
-Advertisement-
Play Games

1、確認mysql是否已安裝,有下麵的代碼可知 2、卸載已安裝的mysql,建議使用yum命令,因為yum命令可以自動刪除與mysql相關的依賴;如果使用rpm命令,則還需要手動去刪除和mysql相關的文件,比較麻煩 3、用whereis命令查找mysql相關的文件,因為步驟2用yum來卸載,所以m ...


1、確認mysql是否已安裝,有下麵的代碼可知

[root@cdh1 zjl]# yum list installed mysql*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Installed Packages
MySQL-python.x86_64 1.2.3-0.3.c1.1.el6 @base                        
mysql-libs.x86_64   5.1.73-8.el6_8     @anaconda-CentOS-201703281317.x86_64/6.9

2、卸載已安裝的mysql,建議使用yum命令,因為yum命令可以自動刪除與mysql相關的依賴;如果使用rpm命令,則還需要手動去刪除和mysql相關的文件,比較麻煩

[root@cdh1 zjl]# yum remove MySQL-python.x86_64 mysql-libs.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6 will be erased
--> Processing Dependency: MySQL-python for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el6.x86_64
---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-8.el6.x86_64
--> Running transaction check
---> Package cloudera-manager-agent.x86_64 0:5.11.1-1.cm5111.p0.9.el6 will be erased
---> Package postfix.x86_64 2:2.6.6-8.el6 will be erased
--> Processing Dependency: /usr/sbin/sendmail for package: redhat-lsb-core-4.0-7.el6.centos.x86_64
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-16.el6_8.2.x86_64
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-16.el6_8.2 will be erased
--> Processing Dependency: cronie = 1.4.4-16.el6_8.2 for package: cronie-anacron-1.4.4-16.el6_8.2.x86_64
---> Package redhat-lsb-core.x86_64 0:4.0-7.el6.centos will be erased
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0 for package: redhat-lsb-printing-4.0-7.el6.centos.x86_64
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0-7.el6.centos for package: redhat-lsb-4.0-7.el6.centos.x86_64
--> Processing Dependency: redhat-lsb-core(x86-64) = 4.0 for package: redhat-lsb-graphics-4.0-7.el6.centos.x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-16.el6_8.2 will be erased
---> Package redhat-lsb.x86_64 0:4.0-7.el6.centos will be erased
--> Processing Dependency: redhat-lsb(x86-64) = 4.0-7.el6.centos for package: redhat-lsb-compat-4.0-7.el6.centos.x86_64
---> Package redhat-lsb-graphics.x86_64 0:4.0-7.el6.centos will be erased
---> Package redhat-lsb-printing.x86_64 0:4.0-7.el6.centos will be erased
--> Running transaction check
---> Package redhat-lsb-compat.x86_64 0:4.0-7.el6.centos will be erased
--> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-33.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be erased
---> Package sysstat.x86_64 0:9.0.4-33.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================
 Package                Arch   Version                  Repository
                                                               Size
====================================================================
Removing:
 MySQL-python           x86_64 1.2.3-0.3.c1.1.el6       @base 246 k
 mysql-libs             x86_64 5.1.73-8.el6_8           @anaconda-CentOS-201703281317.x86_64/6.9
                                                              4.0 M
Removing for dependencies:
 cloudera-manager-agent x86_64 5.11.1-1.cm5111.p0.9.el6 @/cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el6.x86_64
                                                               71 M
 cronie                 x86_64 1.4.4-16.el6_8.2         @anaconda-CentOS-201703281317.x86_64/6.9
                                                              174 k
 cronie-anacron         x86_64 1.4.4-16.el6_8.2         @anaconda-CentOS-201703281317.x86_64/6.9
                                                               43 k
 crontabs               noarch 1.10-33.el6              @anaconda-CentOS-201703281317.x86_64/6.9
                                                              2.4 k
 postfix                x86_64 2:2.6.6-8.el6            @anaconda-CentOS-201703281317.x86_64/6.9
                                                              9.7 M
 redhat-lsb             x86_64 4.0-7.el6.centos         @anaconda-CentOS-201703281317.x86_64/6.9
                                                              0.0  
 redhat-lsb-compat      x86_64 4.0-7.el6.centos         @anaconda-CentOS-201703281317.x86_64/6.9
                                                              0.0  
 redhat-lsb-core        x86_64 4.0-7.el6.centos         @anaconda-CentOS-201703281317.x86_64/6.9
                                                               22 k
 redhat-lsb-graphics    x86_64 4.0-7.el6.centos         @anaconda-CentOS-201703281317.x86_64/6.9
                                                              0.0  
 redhat-lsb-printing    x86_64 4.0-7.el6.centos         @anaconda-CentOS-201703281317.x86_64/6.9
                                                              0.0  
 sysstat                x86_64 9.0.4-33.el6             @anaconda-CentOS-201703281317.x86_64/6.9
                                                              826 k

Transaction Summary
====================================================================
Remove       13 Package(s)

Installed size: 86 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Erasing    : redhat-lsb-compat-4.0-7.el6.centos.x86_64       1/13 
  Erasing    : redhat-lsb-4.0-7.el6.centos.x86_64              2/13 
  Erasing    : cloudera-manager-agent-5.11.1-1.cm5111.p0.9.    3/13 
warning: /etc/cloudera-scm-agent/config.ini saved as /etc/cloudera-scm-agent/config.ini.rpmsave
  Erasing    : redhat-lsb-graphics-4.0-7.el6.centos.x86_64     4/13 
  Erasing    : redhat-lsb-printing-4.0-7.el6.centos.x86_64     5/13 
  Erasing    : redhat-lsb-core-4.0-7.el6.centos.x86_64         6/13 
/var/tmp/rpm-tmp.jLbJUk: line 1: lsb_release: command not found
  Erasing    : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64          7/13 
  Erasing    : sysstat-9.0.4-33.el6.x86_64                     8/13 
  Erasing    : crontabs-1.10-33.el6.noarch                     9/13 
  Erasing    : cronie-anacron-1.4.4-16.el6_8.2.x86_64         10/13 
  Erasing    : cronie-1.4.4-16.el6_8.2.x86_64                 11/13 
  Erasing    : 2:postfix-2.6.6-8.el6.x86_64                   12/13 
  Erasing    : mysql-libs-5.1.73-8.el6_8.x86_64               13/13 
  Verifying  : redhat-lsb-printing-4.0-7.el6.centos.x86_64     1/13 
  Verifying  : cronie-anacron-1.4.4-16.el6_8.2.x86_64          2/13 
  Verifying  : cronie-1.4.4-16.el6_8.2.x86_64                  3/13 
  Verifying  : 2:postfix-2.6.6-8.el6.x86_64                    4/13 
  Verifying  : redhat-lsb-4.0-7.el6.centos.x86_64              5/13 
  Verifying  : redhat-lsb-core-4.0-7.el6.centos.x86_64         6/13 
  Verifying  : cloudera-manager-agent-5.11.1-1.cm5111.p0.9.    7/13 
  Verifying  : crontabs-1.10-33.el6.noarch                     8/13 
  Verifying  : redhat-lsb-compat-4.0-7.el6.centos.x86_64       9/13 
  Verifying  : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64         10/13 
  Verifying  : redhat-lsb-graphics-4.0-7.el6.centos.x86_64    11/13 
  Verifying  : sysstat-9.0.4-33.el6.x86_64                    12/13 
  Verifying  : mysql-libs-5.1.73-8.el6_8.x86_64               13/13 

Removed:
  MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6                          
  mysql-libs.x86_64 0:5.1.73-8.el6_8                                

Dependency Removed:
  cloudera-manager-agent.x86_64 0:5.11.1-1.cm5111.p0.9.el6          
  cronie.x86_64 0:1.4.4-16.el6_8.2                                  
  cronie-anacron.x86_64 0:1.4.4-16.el6_8.2                          
  crontabs.noarch 0:1.10-33.el6                                     
  postfix.x86_64 2:2.6.6-8.el6                                      
  redhat-lsb.x86_64 0:4.0-7.el6.centos                              
  redhat-lsb-compat.x86_64 0:4.0-7.el6.centos                       
  redhat-lsb-core.x86_64 0:4.0-7.el6.centos                         
  redhat-lsb-graphics.x86_64 0:4.0-7.el6.centos                     
  redhat-lsb-printing.x86_64 0:4.0-7.el6.centos                     
  sysstat.x86_64 0:9.0.4-33.el6                                     

Complete!

3、用whereis命令查找mysql相關的文件,因為步驟2用yum來卸載,所以mysql被清理得很乾凈;如果使用rpm將會很麻煩,有很多的文件需要手動清除

[root@cdh1 zjl]# whereis mysql
mysql:

4、查看系統中的mysql安裝包

[root@cdh1 zjl]# yum list mysql*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Available Packages
MySQL-python.x86_64                                                                                        1.2.3-0.3.c1.1.el6                                                                                base
mysql.x86_64                                                                                               5.1.73-8.el6_8                                                                                    base
mysql-bench.x86_64                                                                                         5.1.73-8.el6_8                                                                                    base
mysql-connector-java.noarch                                                                                1:5.1.17-6.el6                                                                                    base
mysql-connector-odbc.x86_64                                                                                5.1.5r1144-7.el6                                                                                  base
mysql-devel.i686                                                                                           5.1.73-8.el6_8                                                                                    base
mysql-devel.x86_64                                                                                         5.1.73-8.el6_8                                                                                    base
mysql-embedded.i686                                                                                        5.1.73-8.el6_8                                                                                    base
mysql-embedded.x86_64                                                                                      5.1.73-8.el6_8                                                                                    base
mysql-embedded-devel.i686                                                                                  5.1.73-8.el6_8                                                                                    base
mysql-embedded-devel.x86_64                                                                                5.1.73-8.el6_8                                                                                    base
mysql-libs.i686                                                                                            5.1.73-8.el6_8                                                                                    base
mysql-libs.x86_64                                                                                          5.1.73-8.el6_8                                                                                    base
mysql-server.x86_64                                                                                        5.1.73-8.el6_8                                                                                    base
mysql-test.x86_64                                                                                          5.1.73-8.el6_8                                                                                    base

5、選擇mysql-server來安裝

[root@cdh1 zjl]# yum install mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.1.73-8.el6_8 will be installed
--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be installed
---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================
 Package                                                Arch                                           Version                                                Repository                                    Size
=================================================================================================================================================================================================================
Installing:
 mysql-server                                           x86_64                                         5.1.73-8.el6_8                                         base                                         8.6 M
Installing for dependencies:
 mysql                                                  x86_64                                         5.1.73-8.el6_8                                         base                                         895 k
 mysql-libs                                             x86_64                                         5.1.73-8.el6_8                                         base                                         1.2 M
 perl-DBD-MySQL                                         x86_64                                         4.013-3.el6                                            base                                         134 k
 perl-DBI                                               x86_64                                         1.609-4.el6                                            base                                         705 k

Transaction Summary
=================================================================================================================================================================================================================
Install       5 Package(s)

Total download size: 12 M
Installed size: 33 M
Is this ok [y/N]: 

6、選擇y繼續安裝

Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-5.1.73-8.el6_8.x86_64.rpm                                                                                                                                                    | 895 kB     00:00     
(2/5): mysql-libs-5.1.73-8.el6_8.x86_64.rpm                                                                                                                                               | 1.2 MB     00:00     
(3/5): mysql-server-5.1.73-8.el6_8.x86_64.rpm                                                                                                                                             | 8.6 MB     00:02     
(4/5): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm                                                                                                                                              | 134 kB     00:00     
(5/5): perl-DBI-1.609-4.el6.x86_64.rpm                                                                                                                                                    | 705 kB     00:00     
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                            2.2 MB/s |  12 MB     00:05     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-libs-5.1.73-8.el6_8.x86_64                                                                                                                                                              1/5 
  Installing : perl-DBI-1.609-4.el6.x86_64                                                                                                                                                                   2/5 
  Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                                                                                                             3/5 
  Installing : mysql-5.1.73-8.el6_8.x86_64                                                                                                                                                                   4/5 
  Installing : mysql-server-5.1.73-8.el6_8.x86_64                                                                                                                                                            5/5 
  Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                                                                                                             1/5 
  Verifying  : mysql-libs-5.1.73-8.el6_8.x86_64                                                                                                                                                              2/5 
  Verifying  : mysql-server-5.1.73-8.el6_8.x86_64                                                                                                                                                            3/5 
  Verifying  : mysql-5.1.73-8.el6_8.x86_64                                                                                                                                                                   4/5 
  Verifying  : perl-DBI-1.609-4.el6.x86_64                                                                                                                                                                   5/5 

Installed:
  mysql-server.x86_64 0:5.1.73-8.el6_8                                                                                                                                                                           

Dependency Installed:
  mysql.x86_64 0:5.1.73-8.el6_8                    mysql-libs.x86_64 0:5.1.73-8.el6_8                    perl-DBD-MySQL.x86_64 0:4.013-3.el6                    perl-DBI.x86_64 0:1.609-4.el6                   

Complete!

7、啟動mysql服務

[root@cdh1 zjl]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h cdh1.zjl.com password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

8、連接一下試一下,直接mysql然後\q關閉連接

[root@cdh1 zjl]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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> \q
Bye

9、設置mysql開機啟動

[root@cdh1 zjl]# chkconfig mysqld on

10、開啟3306埠,並保存

[root@cdh1 zjl]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
[root@cdh1 zjl]# /etc/rc.d/init.d/iptables save

11、連接mysql設置密碼

[root@cdh1 zjl]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password('123') where user='root';
Query OK, 3 rows affected (0.02 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql> \q
Bye

12、重啟mysql服務

[root@cdh1 zjl]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

 


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

-Advertisement-
Play Games
更多相關文章
  • 全部表 select table_name from user_tables; //當前用戶擁有的表 select table_name from all_tables; //所有用戶的表 select table_name from dba_tables; //包括系統表 表的註釋 select ... ...
  • 很久之前用到的,現在整理在這,裡面一些代碼來源於網上,不過有些bug已被我修改了。 1.查詢結果轉XML 其中 為要查詢的語句, XML格式數據, XML轉成字元串 2.查詢結果轉JSON 查詢結果轉換成json需要經過兩個步驟,首先將查詢結果轉成XML數據,然後通過XML數據轉成json XML轉 ...
  • 右擊還存在的訂閱,生成腳本,有個過程sp_addpullsubscription_agent 執行,發現報錯說distribution agent 已經存在 執行: UPDATE dbo.MSreplication_subscriptions SET distribution_agent =NULL ...
  • GETDATE,datepart,DATEPART,DATEADD,DATEDIFF,DATENAME,YEAR,MONTH,DAY,CONVERT ...
  • 通過存儲過程獲取當前日期(或指定日期)所在的日期區間,包含年、月、周、日。 sql CREATE PROCEDURE [dbo].[GetDataPeriod] @defaultDate DATE=NULL, @period VARCHAR(1)=NULL, @startDate DATE OUTP ...
  • 一、確認防火牆沒有阻止3306埠(一般伺服器預設會屏蔽掉) windows防火牆例外設置方法 控制面板(右上角選擇查看方式為大圖標) 防火牆 高級設置 高級設置 出站規則 最右邊 新建規則“新建出站規則嚮導”,在嚮導的第一步,選擇要創建的防火牆規則類型,選擇第二個“埠”。 windows防火牆添 ...
  • jdbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=utf8&autoReconnect=true&rewr ...
  • 在傳遞數據時,XML和JSON是最常用的數據格式,SQL Server從很早的版本就開始支持XML格式,而對於JSON格式,SQL Server從2016版本開始支持。大多數資料庫系統並沒有升級到SQL Server 2016版本,因此在傳遞格式化的數據時,通常還是使用XML格式。對我而言,查詢和解 ...
一周排行
    -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.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...