Mysql8.0修改lower_case_table_names參數導致重啟失敗

来源:https://www.cnblogs.com/greatsql/archive/2022/08/29/16634739.html
-Advertisement-
Play Games

GreatSQL社區原創內容未經授權不得隨意使用,轉載請聯繫小編並註明來源。 GreatSQL是MySQL的國產分支版本,使用上與MySQL一致。 事件起因:在測試一個數據遷移工具時,源端oracle19c數據遷移到目標端mysql8.0,提示遷移目標端 Unknown database 'SBTE ...


  • GreatSQL社區原創內容未經授權不得隨意使用,轉載請聯繫小編並註明來源。
  • GreatSQL是MySQL的國產分支版本,使用上與MySQL一致。

事件起因:在測試一個數據遷移工具時,源端oracle19c數據遷移到目標端mysql8.0,提示遷移目標端 Unknown database 'SBTEST',報錯如下:

2022-07-29 10:08:19,155 ERROR com.greatsync.connector.jdbc.internal.ComplexJdbcOutputFormat [] - JDBC executeBatch error, retry times = 0
java.sql.BatchUpdateException: Unknown database 'SBTEST'
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_312]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_312]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_312]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_312]
	at com.mysql.cj.util.Util.handleNewInstance(Util.java:192) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.util.Util.getInstance(Util.java:167) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.util.Util.getInstance(Util.java:174) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:755) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:426) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:795) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.greatsync.connector.jdbc.statement.FieldNamedPreparedStatementImpl.executeBatch(FieldNamedPreparedStatementImpl.java:77) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at com.greatsync.connector.jdbc.internal.executor.TableSimpleStatementExecutor.executeBatch(TableSimpleStatementExecutor.java:63) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at com.greatsync.connector.jdbc.internal.executor.TableBufferReducedStatementExecutor.executeBatch(TableBufferReducedStatementExecutor.java:121) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at com.greatsync.connector.jdbc.internal.ComplexJdbcOutputFormat.attemptFlush(ComplexJdbcOutputFormat.java:243) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at com.greatsync.connector.jdbc.internal.ComplexJdbcOutputFormat.flush(ComplexJdbcOutputFormat.java:210) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at com.greatsync.connector.jdbc.internal.ComplexJdbcSinkFunction.lambda$open$0(ComplexJdbcSinkFunction.java:63) ~[blob_p-90078b57fb2c51eb5935c045d2e493ef0a7d1524-e9c0e1166eea1bd94ba3d5a23c03b9b3:?]
	at org.apache.flink.streaming.runtime.tasks.StreamTask.invokeProcessingTimeCallback(StreamTask.java:1693) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$null$22(StreamTask.java:1684) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.runThrowing(StreamTaskActionExecutor.java:50) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.mailbox.Mail.run(Mail.java:90) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMailsNonBlocking(MailboxProcessor.java:353) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMail(MailboxProcessor.java:317) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:201) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:809) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:761) ~[flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:958) [flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:937) [flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:766) [flink-dist_2.11-1.14.4.jar:1.14.4]
	at org.apache.flink.runtime.taskmanager.Task.run(Task.java:575) [flink-dist_2.11-1.14.4.jar:1.14.4]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.sql.SQLSyntaxErrorException: Unknown database 'SBTEST'
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchedInserts(ClientPreparedStatement.java:716) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	... 22 more

於是查看了目標端mysql的databases:

mysql> select @@version,@@default_storage_engine;
+-----------+--------------------------+
| @@version | @@default_storage_engine |
+-----------+--------------------------+
| 8.0.29    | InnoDB                   |
+-----------+--------------------------+
1 row in set (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sbtest             |
| sys                |
+--------------------+
5 rows in set (0.01 sec)
--使用大寫的database name,報錯
mysql> use SBTEST
ERROR 1049 (42000): Unknown database 'SBTEST'
--使用小寫的database name,可以正常訪問
mysql> use sbtest
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

發現目標端是存在sbtest這個庫,但是只能小寫訪問,繼續檢查大小寫敏感配置

mysql> select @@lower_case_table_names;
+--------------------------+
| @@lower_case_table_names |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (0.00 sec)

mysql> 

可見目標端的mysql8.0未開啟忽略大寫的配置,oracle的對象名稱預設是大寫,遷移工具遷移時未進行對象名稱轉小寫,導致遷移失敗,程式報錯
這時的想法那手動改下lower_case_table_names不就行了,於是就有瞭如下的操作:
修改mysql配置文件:

#my.cnf配置中增加如下配置
lower-case-table-names=1

重啟我的mysql8.0 docker容器並查看日誌:

root@mysql:~# docker restart mysql8.0.29 
mysql8.0.29
root@mysql:~# docker logs -f mysql8.0.29
2022-07-29 02:28:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.
2022-07-29 02:28:48+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-29 02:28:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.
2022-07-29T02:28:48.532695-00:00 0 [Warning] [MY-011068] [Server] The syntax 'log_slave_updates' is deprecated and will be removed in a future release. Please use log_replica_updates instead.
2022-07-29T02:28:48.532736-00:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2022-07-29T02:28:48.532776-00:00 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-07-29T02:28:48.532794-00:00 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-29T02:28:48.541090-00:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-29T02:28:50.875623-00:00 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-29T02:28:50.896028-00:00 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').
2022-07-29T02:28:50.896513-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-29T02:28:50.897228-00:00 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-29T02:28:51.615910-00:00 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29)  MySQL Community Server - GPL.
2022-07-29 02:28:53+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.
2022-07-29 02:28:53+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-29 02:28:53+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1debian10 started.
2022-07-29T02:28:54.151877-00:00 0 [Warning] [MY-011068] [Server] The syntax 'log_slave_updates' is deprecated and will be removed in a future release. Please use log_replica_updates instead.
2022-07-29T02:28:54.151918-00:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2022-07-29T02:28:54.151954-00:00 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-07-29T02:28:54.151972-00:00 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-29T02:28:54.401739-00:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-29T02:28:56.161607-00:00 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-29T02:28:56.166187-00:00 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').
2022-07-29T02:28:56.166354-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-29T02:28:56.166517-00:00 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-29T02:28:56.800121-00:00 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29)  MySQL Community Server - GPL.

咦,居然重啟失敗並報錯,我記得之前mysql5.7上是可以修改成功的,於是在mysql5.7上復現了一下該修改操作:

mysql> select @@version,@@default_storage_engine;
+------------+--------------------------+
| @@version  | @@default_storage_engine |
+------------+--------------------------+
| 5.7.37-log | InnoDB                   |
+------------+--------------------------+
1 row in set (0.00 sec)

mysql> select @@lower_case_table_names;
+--------------------------+
| @@lower_case_table_names |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (0.00 sec)

配置文件中添加:lower-case-table-names=1後重啟mysql5.7的docker容器

root@mysql:~#docker restart mysql5.7 
mysql5.7
-- 查看日誌,重啟成功
root@mysql:~#docker logs -f mysql5.7 
2022-07-29 04:36:00+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.37-1debian10 started.
2022-07-29 04:36:01+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-29 04:36:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.37-1debian10 started.
2022-07-29T04:36:02.585577-00:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-07-29T04:36:02.585636-00:00 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2022-07-29T04:36:02.585657-00:00 0 [Note] mysqld (mysqld 5.7.37-log) starting as process 1 ...
2022-07-29T04:36:02.589953-00:00 0 [Note] InnoDB: PUNCH HOLE support available
2022-07-29T04:36:02.589965-00:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-07-29T04:36:02.589968-00:00 0 [Note] InnoDB: Uses event mutexes
2022-07-29T04:36:02.589970-00:00 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-07-29T04:36:02.589972-00:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-29T04:36:02.589974-00:00 0 [Note] InnoDB: Using Linux native AIO
2022-07-29T04:36:02.590203-00:00 0 [Note] InnoDB: Number of pools: 1
2022-07-29T04:36:02.590301-00:00 0 [Note] InnoDB: Using CPU crc32 instructions
2022-07-29T04:36:02.591501-00:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-07-29T04:36:02.598983-00:00 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-29T04:36:02.600436-00:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-07-29T04:36:02.611754-00:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-07-29T04:36:02.691303-00:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-07-29T04:36:02.691434-00:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-07-29T04:36:02.886567-00:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-07-29T04:36:02.888579-00:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2022-07-29T04:36:02.888614-00:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2022-07-29T04:36:02.889822-00:00 0 [Note] InnoDB: 5.7.37 started; log sequence number 12662238
2022-07-29T04:36:02.890218-00:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-07-29T04:36:02.890839-00:00 0 [Note] Plugin 'FEDERATED' is disabled.
2022-07-29T04:36:02.897432-00:00 0 [Note] InnoDB: Buffer pool(s) load completed at 220729  4:36:02
2022-07-29T04:36:03.150414-00:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2022-07-29T04:36:03.150468-00:00 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2022-07-29T04:36:03.150482-00:00 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-07-29T04:36:03.150491-00:00 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-07-29T04:36:03.151831-00:00 0 [Warning] CA certificate ca.pem is self signed.
2022-07-29T04:36:03.151851-00:00 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2022-07-29T04:36:03.151929-00:00 0 [Note] Server hostname (bind-address): '*'; port: 3306
2022-07-29T04:36:03.151953-00:00 0 [Note] IPv6 is available.
2022-07-29T04:36:03.151961-00:00 0 [Note]   - '::' resolves to '::';
2022-07-29T04:36:03.151968-00:00 0 [Note] Server socket created on IP: '::'.
2022-07-29T04:36:03.206432-00:00 0 [Warning] Insecure configuration for --pid-file: Location '/var/lib/mysql' in the path is accessible to all OS users. Consider choosing a different directory.
2022-07-29T04:36:03.218018-00:00 0 [Note] Failed to start slave threads for channel ''
2022-07-29T04:36:03.234065-00:00 0 [Note] Event Scheduler: Loaded 0 events
2022-07-29T04:36:03.234636-00:00 0 [Note] mysqld: ready for connections.
Version: '5.7.37-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

查看配置生效了:

mysql> root@mysql:~# docker exec -it mysql5.7  bash
root@f9bc50f17027:/# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37-log MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> select @@lower_case_table_names;
+--------------------------+
| @@lower_case_table_names |
+--------------------------+
|                        1 |
+--------------------------+
1 row in set (0.00 sec)

確實mysql5.7是支持修改的,mysql8.0不支持修改,於是查了mysql8.0的官網解釋:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names

-- linux未設置預設是0
The default value of this variable is platform-dependent (see lower_case_file_system). On Linux and other Unix-like systems, the default is 0. On Windows the default value is 1. On macOS, the default value is 2. On Linux (and other Unix-like systems), setting the value to 2 is not supported; the server forces the value to 0 instead.

-- 禁止使用與伺服器初始化時使用的設置不同的lower_case_table_names啟動伺服器
It is prohibited to start the server with a lower_case_table_names setting that is different from the setting used when the server was initialized. The restriction is necessary because collations used by various data dictionary table fields are determined by the setting defined when the server is initialized, and restarting the server with a different setting would introduce inconsistencies with respect to how identifiers are ordered and compared.

-- 在初始化伺服器之前,有必要將lower_case_table_names配置為所需的設置
It is therefore necessary to configure lower_case_table_names to the desired setting before initializing the server. In most cases, this requires configuring lower_case_table_names in a MySQL option file before starting the MySQL server for the first time.

原來需要mysql.0初始化的時候就需要設置好,並且後續不支持修改。於是我又重新用docker部署了一個新的mysql8.0資料庫繼續測試。

參數說明

  • lower_case_table_names=0 表名存儲為給定的大小和比較是區分大小寫的
  • lower_case_table_names = 1 表名存儲在磁碟是小寫的,但是比較的時候是不區分大小寫
  • lower_case_table_names=2 表名存儲為給定的大小寫但是比較的時候是小寫的
    unix,linux下lower_case_table_names預設值為 0 .Windows下預設值是 1 .Mac OS X下預設值是 2

總結

可見我們在使用mysql8.0前需要根據自己的使用場景評估是否要開啟忽略大小寫,如果需要開啟忽略大小寫,初始化前需要把lower-case-table-names=1寫入到my.cnf配置文件中,這樣才不會影響後續的使用。

關於 GreatSQL

GreatSQL是由萬里資料庫維護的MySQL分支,專註於提升MGR可靠性及性能,支持InnoDB並行查詢特性,是適用於金融級應用的MySQL分支版本。

GreatSQL社區 Gitee GitHub Bilibili

GreatSQL社區:

歡迎來GreatSQL社區發帖提問
https://greatsql.cn/

GreatSQL社區

技術交流群:

微信:掃碼添加GreatSQL社區助手微信好友,發送驗證信息加群

圖片


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

-Advertisement-
Play Games
更多相關文章
  • 電動勢,是導體內電子運動的必要條件,也是電子運動趨勢的一種表現,因而具有一定的方向性。 電動勢的方向,規定為從電源的負極,經過電源內部指向電源的正極,即與電源兩端電壓的方向相反。 反電動勢,是指由反抗電流發生改變的趨勢而產生電動勢。 反電動勢一般出現在電磁線圈中,如繼電器線圈、電磁閥、接觸器線圈、電 ...
  • MediaHuman YouTube Downloader for Mac是一款適用於mac視頻下載軟體。mediahuman youtube mac支持多個視頻同時下載,支持超高解析度包括4K和8K,支持YouTube,Vimeo,DAIlymotion,Soundcloud等。此外,還有一個選項 ...
  • Cool Menu 是 macOS 上的包含 11 個超級實用功能的組合,把這些軟體卸載清理,亮度,調屏,磁碟空間優化等功能集中在一個菜單欄的小工具中,不會占用太多的空間,是很實用的一款軟體。 詳情:Cool Menu for Mac(菜單欄應用程式) 功能特色 可用磁碟空間 Cool Menu的全 ...
  • 真實面試題分享!本文基於餐飲業數據,使用SQL分析挖掘客戶的就餐模式、點餐花費和菜品喜好等,以提升餐廳的業務經營水平。 ...
  • 摘要:SQL語句解析完成後被解析成Query結構,在進行優化時是以Query為單位進行的,Query的優化分為基於規則的邏輯優化(查詢重寫)和基於代價的物理優化(計劃生成),主入口函數為subquery_planner。subquery_planner函數接收Query(查詢樹),返回一個Plan( ...
  • ClickHouse 是一個真正的列式資料庫管理系統(DBMS)。在 ClickHouse 中,數據始終是按列存儲的,包括矢量(向量或列塊)執行的過程。只要有可能,操作都是基於矢量進行分派的,而不是單個的值,這被稱為«矢量化查詢執行»,它有利於降低實際的數據處理開銷。 ...
  • 一、介紹 在介紹 MongoDB 之前,我先介紹一下業務開發的時候遇到的痛點,以便大家對它有一個更加清晰的認識! 最近在用資料庫存儲數據的時候發現這麼一個坑,例如從消息隊列中監聽消息的時候,原來的做法是將監聽的消息數據存儲在資料庫,以便好對異常消息數據進行追溯,消息內容使用text類型存儲,起初因為 ...
  • 首發微信公眾號:SQL資料庫運維 原文鏈接:https://mp.weixin.qq.com/s?__biz=MzI1NTQyNzg3MQ==&mid=2247485212&idx=1&sn=450e9e94fa709b5eeff0de371c62072b&chksm=ea37536cdd40da7 ...
一周排行
    -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.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...