多實例mysql的安裝和管理

来源:http://www.cnblogs.com/zhenghongxin/archive/2016/03/04/5240921.html
-Advertisement-
Play Games

mysql的多實例有兩種方式可以實現,兩種方式各有利弊。第一種是使用多個配置文件啟動不同的進程來實現多實例,這種方式的優勢邏輯簡單,配置簡單,缺點是管理起來不太方便。第二種是通過官方自帶的mysqld_multi使用單獨的配置文件來實現多實例,這種方式定製每個實例的配置不太方面,優點是管理起來很方便


mysql的多實例有兩種方式可以實現,兩種方式各有利弊。
第一種是使用多個配置文件啟動不同的進程來實現多實例,這種方式的優勢邏輯簡單,配置簡單,缺點是管理起來不太方便。
第二種是通過官方自帶的mysqld_multi使用單獨的配置文件來實現多實例,這種方式定製每個實例的配置不太方面,優點是管理起來很方便,集中管理。

下麵就分別來實戰這兩種多實例的安裝和管理

環境介紹:

mysql 版本:5.1.50

操作系統:SUSE 11

mysql實例數:3個

實例占用埠分別為:3306、3307、3308

創建mysql用戶
    /usr/sbin/groupadd mysql
    /usr/sbin/useradd -g mysql mysql

編譯安裝mysql

tar xzvf mysql-5.1.50.tar.gz
    cd mysql-5.1.50
    ./configure '--prefix=/usr/local/mysql' '--with-charset=utf8' '--with-extra-charsets=complex' '--with-pthread' '--enable-thread-safe-client' '--with-ssl' '--with-client-ldflags=-all-static' '--with-mysqld-ldflags=-all-static' '--with-plugins=partition,innobase,blackhole,myisam,innodb_plugin,heap,archive' '--enable-shared' '--enable-assembler'
    make
    make install

初始化資料庫

    /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/dbdata_3306 --user=mysql
    /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/dbdata_3307 --user=mysql
    /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/dbdata_3308 --user=mysql
創建配置文件 vim /data/dbdata_3306/my.cnf 3306的配置文件如下:
    [client]
    port = 3306
    socket = /data/dbdata_3306/mysql.sock
    [mysqld]
    datadir=/data/dbdata_3306/
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    port = 3306
    socket = /data/dbdata_3306/mysql.sock
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqldump]
    quick
    max_allowed_packet = 256M
    [mysql]
    no-auto-rehash
    prompt=\\u@\\d \\R:\\m>
    [myisamchk]
    key_buffer_size = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M
    [mysqlhotcopy]
    interactive-timeout
    [mysqld_safe]
    open-files-limit = 8192
vim /data/dbdata_3307/my.cnf 3307的配置文件如下:
    [client]
    port = 3307
    socket = /data/dbdata_3307/mysql.sock
    [mysqld]
    datadir=/data/dbdata_3307/
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    port = 3307
    socket = /data/dbdata_3307/mysql.sock
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqldump]
    quick
    max_allowed_packet = 256M
    [mysql]
    no-auto-rehash
    prompt=\\u@\\d \\R:\\m>
    [myisamchk]
    key_buffer_size = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M
    [mysqlhotcopy]
    interactive-timeout
    [mysqld_safe]
    open-files-limit = 8192
vim /data/dbdata_3308/my.cnf 3308的配置文件如下:
    [client]
    port = 3308
    socket = /data/dbdata_3308/mysql.sock
    [mysqld]
    datadir=/data/dbdata_3308/
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    port = 3308
    socket = /data/dbdata_3308/mysql.sock
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqldump]
    quick
    max_allowed_packet = 256M
    [mysql]
    no-auto-rehash
    prompt=\\u@\\d \\R:\\m>
    [myisamchk]
    key_buffer_size = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M
    [mysqlhotcopy]
    interactive-timeout
    [mysqld_safe]
    open-files-limit = 8192

創建自動啟動文件

vim /data/dbdata_3306/mysqld 3306的啟動文件如下:
    #!/bin/bash
    mysql_port=3306
    mysql_username="admin"
    mysql_password="password"
    function_start_mysql()
    {
    printf "Starting MySQL...\n"
    /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/dbdata_${mysql_port}/my.cnf 2>&1 > /dev/null &
    }
    function_stop_mysql()
    {
    printf "Stoping MySQL...\n"
    /usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /data/dbdata_${mysql_port}/mysql.sock shutdown
    }
    function_restart_mysql()
    {
    printf "Restarting MySQL...\n"
    function_stop_mysql
    function_start_mysql
    }
    function_kill_mysql()
    {
    kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
    kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
    }
    case $1 in
    start)
    function_start_mysql;;
    stop)
    function_stop_mysql;;
    kill)
    function_kill_mysql;;
    restart)
    function_stop_mysql
    function_start_mysql;;
    *)
    echo "Usage: /data/dbdata_${mysql_port}/mysqld {start|stop|restart|kill}";;
    esac
vim /data/dbdata_3307/mysqld 3307的啟動文件如下:
    #!/bin/bash
    mysql_port=3307
    mysql_username="admin"
    mysql_password="password"
    function_start_mysql()
    {
    printf "Starting MySQL...\n"
    /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/dbdata_${mysql_port}/my.cnf 2>&1 > /dev/null &
    }
    function_stop_mysql()
    {
    printf "Stoping MySQL...\n"
    /usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /data/dbdata_${mysql_port}/mysql.sock shutdown
    }
    function_restart_mysql()
    {
    printf "Restarting MySQL...\n"
    function_stop_mysql
    function_start_mysql
    }
    function_kill_mysql()
    {
    kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
    kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
    }
    case $1 in
    start)
    function_start_mysql;;
    stop)
    function_stop_mysql;;
    kill)
    function_kill_mysql;;
    restart)
    function_stop_mysql
    function_start_mysql;;
    *)
    echo "Usage: /data/dbdata_${mysql_port}/mysqld {start|stop|restart|kill}";;
    esac
vim /data/dbdata_3308/mysqld 3308的啟動文件如下:
    #!/bin/bash
    mysql_port=3308
    mysql_username="admin"
    mysql_password="password"
    function_start_mysql()
    {
    printf "Starting MySQL...\n"
    /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/dbdata_${mysql_port}/my.cnf 2>&1 > /dev/null &
    }
    function_stop_mysql()
    {
    printf "Stoping MySQL...\n"
    /usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /data/dbdata_${mysql_port}/mysql.sock shutdown
    }
    function_restart_mysql()
    {
    printf "Restarting MySQL...\n"
    function_stop_mysql
    function_start_mysql
    }
    function_kill_mysql()
    {
    kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
    kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
    }
    case $1 in
    start)
    function_start_mysql;;
    stop)
    function_stop_mysql;;
    kill)
    function_kill_mysql;;
    restart)
    function_stop_mysql
    function_start_mysql;;
    *)
    echo "Usage: /data/dbdata_${mysql_port}/mysqld {start|stop|restart|kill}";;
    esac

啟動3306、3307、3308的mysql

    /data/dbdata_3306/mysqld start
    /data/dbdata_3307/mysqld start
    /data/dbdata_3308/mysqld start

更改原來密碼(處於安全考慮,還需要刪除系統中沒有密碼的帳號,這裡省略了):

    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3306/mysql.sock
    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3307/mysql.sock
    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3308/mysql.sock

登錄測試並創建關閉mysql的帳號許可權,mysqld腳本要用到!

    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
創建了admin帳號以後腳本的stop功能和restart功能就正常了! 更改環境變數
    vim /etc/profile 添加下麵一行內容
    PATH=${PATH}:/usr/local/mysql/bin/
    source /etc/profile

添加到自動啟動

    vim /etc/init.d/boot.local
    /data/dbdata_3306/mysqld start
    /data/dbdata_3307/mysqld start
    /data/dbdata_3308/mysqld start
如果是rhel或者centos系統的話自啟動文件/etc/rc.local   管理的話,在本地都是採用 -S /data/dbdata_3308/mysql.sock,如果在遠程可以通過不同的埠連接上去坐管理操作。其他的和單實例的管理沒什麼區別! 再來看第二種通過官方自帶的mysqld_multi來實現多實例實戰:
這裡的mysql安裝以及資料庫的初始化和前面的步驟一樣,就不再贅述。
mysqld_multi的配置 vim /etc/my.cnf
    [mysqld_multi]
    mysqld = /usr/local/mysql/bin/mysqld_safe
    mysqladmin = /usr/local/mysql/bin/mysqladmin
    user = admin
    password = password
    [mysqld1]
    socket = /data/dbdata_3306/mysql.sock
    port = 3306
    pid-file = /data/dbdata_3306/3306.pid
    datadir = /data/dbdata_3306
    user = mysql
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqld2]
    socket = /data/dbdata_3307/mysql.sock
    port = 3307
    pid-file = /data/dbdata_3307/3307.pid
    datadir = /data/dbdata_3307
    user = mysql
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqld3]
    socket = /data/dbdata_3308/mysql.sock
    port = 3308
    pid-file = /data/dbdata_3308/3308.pid
    datadir = /data/dbdata_3308
    user = mysql
    skip-name-resolve
    lower_case_table_names=1
    innodb_file_per_table=1
    back_log = 50
    max_connections = 300
    max_connect_errors = 1000
    table_open_cache = 2048
    max_allowed_packet = 16M
    binlog_cache_size = 2M
    max_heap_table_size = 64M
    sort_buffer_size = 2M
    join_buffer_size = 2M
    thread_cache_size = 64
    thread_concurrency = 8
    query_cache_size = 64M
    query_cache_limit = 2M
    ft_min_word_len = 4
    default-storage-engine = innodb
    thread_stack = 192K
    transaction_isolation = REPEATABLE-READ
    tmp_table_size = 64M
    log-bin=mysql-bin
    binlog_format=mixed
    slow_query_log
    long_query_time = 1
    server-id = 1
    key_buffer_size = 8M
    read_buffer_size = 2M
    read_rnd_buffer_size = 2M
    bulk_insert_buffer_size = 64M
    myisam_sort_buffer_size = 128M
    myisam_max_sort_file_size = 10G
    myisam_repair_threads = 1
    myisam_recover
    innodb_additional_mem_pool_size = 16M
    innodb_buffer_pool_size = 200M
    innodb_data_file_path = ibdata1:10M:autoextend
    innodb_file_io_threads = 8
    innodb_thread_concurrency = 16
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 16M
    innodb_log_file_size = 512M
    innodb_log_files_in_group = 3
    innodb_max_dirty_pages_pct = 60
    innodb_lock_wait_timeout = 120
    [mysqldump]
    quick
    max_allowed_packet = 256M
    [mysql]
    no-auto-rehash
    prompt=\\u@\\d \\R:\\m>
    [myisamchk]
    key_buffer_size = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M
    [mysqlhotcopy]
    interactive-timeout
    [mysqld_safe]
    open-files-limit = 8192

mysqld_multi啟動

    /usr/local/mysql/bin/mysqld_multi start 1
    /usr/local/mysql/bin/mysqld_multi start 2
    /usr/local/mysql/bin/mysqld_multi start 3

或者採用一條命令的形式:

    /usr/local/mysql/bin/mysqld_multi start 1-3

更改原來密碼(處於安全考慮,還需要刪除系統中沒有密碼的帳號,這裡省略了):

    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3306/mysql.sock
    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3307/mysql.sock
    /usr/local/mysql/bin/mysqladmin -uroot password 'password' -S /data/dbdata_3308/mysql.sock

登錄測試並創建admin密碼(停止mysql的時候需要使用到)

    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
    /usr/local/mysql/bin/mysql -uroot -ppassword -S /data/dbdata_3308/mysql.sock
    GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
    flush privileges;
更改環境變數
    vim /etc/profile
    PATH=${PATH}:/usr/local/mysql/bin/
    source /etc/profile

添加到自動啟動

    vim /etc/init.d/boot.local
    /usr/local/mysql/bin/mysqld_multi start 1-3
如果是rhel或者centos系統的話自啟動文件/etc/rc.local   管理的話,在本地都是採用 -S /data/dbdata_3308/mysql.sock,如果在遠程可以通過不同的埠連接上去坐管理操作。其他的和單實例的管理沒什麼區別!

大家在管理多實例的話可以使用mysqlmanager實例管理器,管理器來會比較方面,限於篇幅,這裡就不在多做介紹!

參考資料:http://blog.chinaunix.net/uid-20639775-id-3438560.html


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

-Advertisement-
Play Games
更多相關文章
  • 就職文博公司要為博物館做APP 涉及到瓦片地圖的編寫 在這裡總結一些開發中遇到的問題 (將會不斷更新 也是學習階段) 著急寫項目的同學 可以直接看code4上現成的瓦片地圖代碼:http://www.code4app.com/ios/Tiled-Scroll-View/4fba3fd66803fa8
  • 開始對liunx界面不熟悉,可能由於不小心,把root誤刪了,怎麼辦? 1. # killall mysqld 幹掉所有mysql進程 2. # mysqld_safe --skip-grant-tables & 進入mysql安全模式 3. 通過上一步進入mysql的console(控制台),輸入
  • package com.wdzj.redis.distributed.lock; import java.util.UUID; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.c
  • 在Alwayson中,可以通過設置來將備份放到指定的節點上完成,微軟提供了函數用來判斷當前指定節點進行備份: DECLARE @database_name NVARCHAR(200) SET @database_name= 'DB5' SELECT CASE [master].[sys].[fn_h
  • 在資料庫操作中,經常有一些這樣的操作:插入諾乾條測試數據、查詢這個月的登錄情況(沒有登錄的日期不能不存在,要顯示數量為0),獲取諾乾條guid。 這些的基礎都是怎麼生成連續的一串數字 1 2 3 4 ……………… 100000。 在oracle中,我們使用start with connect by
  • 1. TokuFT file system space is really low and access is restricted 解決方法:修改tokudb_fs_reserve_percent參數,不過該參數是靜止參數,需重啟實例 具體可參考:http://www.cnblogs.com/zu
  • 資料庫概述 用自定義文件格式保存數據的劣勢 database management system,資料庫管理系統和資料庫。 不同品牌的dbms有自己的不同特點:mysql(速度快,適合網站),mssqlserver(和.net結合好),db2,oracle,access,sybase等,對開發人員來
  • 修改root密碼的方法有很多種,下麵我來給大家總結一些常用的MySQL數據修改root密碼方法,有需要瞭解或忘記root密碼的朋友可進入參考。 方法一,用mysqladmin 這裡使用了到了Mysql自帶的兩種命令mysqladmin.exe和mysql.exe,mysqladmin修改密碼的命令格
一周排行
    -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.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...