RHELMariaDB
bitsCN.comInstallation MariaDB5.5 on RHEL6
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel ssse2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gettext-devel libXpm-devel libtool perl-DBD-MySQL bison cmake [root@test mariadb-5.5.33a]# mkdir -p /data/mariadb5.5 /service/mariadb5.5 [root@test mariadb-5.5.33a]# cmake . -DCMAKE_INSTALL_PREFIX=/service/mariadb5.5 -DMYSQL_UNIX_ADDR=/data/mariadb5.5/mariadb.sock -DMYSQL_DATADIR=/data/mariadb5.5 -DSYSCONFDIR=/service/mariadb5.5 -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=30308 -DWITH_XTRADB_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BIG_TABLES=1 -DWITH_DEBUG=0 -DCOMPILATION_COMMENT=ZWC-MariaDB [root@test mariadb-5.5.33a]# make && make install [root@test ~]# cat /service/mariadb5.5/my.cnf [client] port = 30308 socket = /data/mariadb5.5/mariadb.sock
[mysqld] port = 30308 socket = /data/mariadb5.5/mariadb.sock skip-external-locking back_log = 500 lower_case_table_names = 1 skip-name-resolve max_connections = 1024 table_open_cache = 512 binlog_cache_size = 1M max_heap_table_size = 300M read_buffer_size = 10M read_rnd_buffer_size = 16M sort_buffer_size = 8M join_buffer_size=4M thread_cache_size = 4 thread_concurrency = 4 query_cache_size = 200M ft_min_word_len = 4 thread_stack = 192K tmp_table_size = 200M slow_query_log long_query_time = 2 slow_query_log_file = /data/mariadb5.5/slowsql.sql key_buffer_size = 32M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 200M myisam_repair_threads = 4 myisam_recover # setup innodb innodb_additional_mem_pool_size = 16M innodb_buffer_pool_size = 2500M innodb_data_file_path = ibdata1:10M:autoextend innodb_write_io_threads = 4 innodb_read_io_threads = 4 innodb_thread_concurrency = 16 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 8M innodb_log_file_size = 512M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 init_connect = 'SET autocommit=0' innodb-file-per-table = 1 innodb-open-file = 500 innodb_flush_method=O_DIRECT open_files_limit = 65535 expire_logs_days = 5 event_scheduler = 1 log-bin=binlog-master binlog_format=mixed server-id = 1 [mysqldump] quick max_allowed_packet = 16M [mysql] prompt=//u@//d //r://m://s> no-auto-rehash [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [root@test ~]# /service/mariadb5.5/scripts/mysql_install_db --defaults-file=/service/mariadb5.5/my.cnf --basedir=/service/mariadb5.5 --datadir=/data/mariadb5.5 --user=mysql Installing MariaDB/MySQL system tables in '/data/mariadb5.5' ... 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 MariaDB root USER ! To do so, start the server, then issue the following commands: '/service/mariadb5.5/bin/mysqladmin' -u root password 'new-password' '/service/mariadb5.5/bin/mysqladmin' -u root -h 192.168.1.9 password 'new-password' Alternatively you can run: '/service/mariadb5.5/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 MariaDB Knowledgebase at http://kb.askmonty.org or the MySQL manual for more instructions. You can start the MariaDB daemon with: cd '/service/mariadb5.5' ; /service/mariadb5.5/bin/mysqld_safe --datadir='/data/mariadb5.5' You can test the MariaDB daemon with mysql-test-run.pl cd '/service/mariadb5.5/mysql-test' ; perl mysql-test-run.pl Please report any problems with the '/service/mariadb5.5/scripts/mysqlbug' script! The latest information about MariaDB is available at http://mariadb.org/. You can find additional information about the MySQL part at: http://dev.mysql.com Support MariaDB development by buying support/new features from Monty Program Ab. You can contact us about this at sales@montyprogram.com. Alternatively consider joining our community based development effort: http://kb.askmonty.org/en/contributing-to-the-mariadb-project/ [root@test ~]# /service/mariadb5.5/bin/mysqld_safe --defaults-file=/service/mariadb5.5/my.cnf --basedir=/service/mariadb5.5 --datadir=/data/mariadb5.5 --user=mysql & [1] 19871 [root@test ~]# 131101 22:58:50 mysqld_safe Logging to '/data/mariadb5.5/test.err'. 131101 22:58:50 mysqld_safe Starting mysqld daemon with databases from /data/mariadb5.5 [root@test ~]# /service/mariadb5.5/bin/mysqladmin -uroot password New password: Confirm new password: [root@test ~]# [root@test ~]# [root@test ~]# /service/mariadb5.5/bin/mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) [root@test ~]# /service/mariadb5.5/bin/mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or /g. Your MariaDB connection id is 5 Server version: 5.5.33a-MariaDB-log ZWC-MariaDB Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others. Type 'help;' or '/h' for help. Type '/c' to clear the current input statement. MariaDB [(none)]> delete from mysql.user where password=''; Query OK, 5 rows affected (0.03 sec) MariaDB [(none)]> delete from mysql.db where user=''; Query OK, 2 rows affected (0.04 sec) MariaDB [(none)]> select @@version; +---------------------+ | @@version | +---------------------+ | 5.5.33a-MariaDB-log | +---------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> show engines; +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | CSV | YES | CSV storage engine | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO | +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.00 sec) MariaDB [(none)]>
Percona-XtraDB, Supports transactions, row-level locking, and foreign keys
bitsCN.com

MySQL和SQLite的主要區別在於設計理念和使用場景:1.MySQL適用於大型應用和企業級解決方案,支持高性能和高並發;2.SQLite適合移動應用和桌面軟件,輕量級且易於嵌入。

MySQL中的索引是數據庫表中一列或多列的有序結構,用於加速數據檢索。 1)索引通過減少掃描數據量提升查詢速度。 2)B-Tree索引利用平衡樹結構,適合範圍查詢和排序。 3)創建索引使用CREATEINDEX語句,如CREATEINDEXidx_customer_idONorders(customer_id)。 4)複合索引可優化多列查詢,如CREATEINDEXidx_customer_orderONorders(customer_id,order_date)。 5)使用EXPLAIN分析查詢計劃,避

在MySQL中使用事務可以確保數據一致性。 1)通過STARTTRANSACTION開始事務,執行SQL操作後用COMMIT提交或ROLLBACK回滾。 2)使用SAVEPOINT可以設置保存點,允許部分回滾。 3)性能優化建議包括縮短事務時間、避免大規模查詢和合理使用隔離級別。

選擇PostgreSQL而非MySQL的場景包括:1)需要復雜查詢和高級SQL功能,2)要求嚴格的數據完整性和ACID遵從性,3)需要高級空間功能,4)處理大數據集時需要高性能。 PostgreSQL在這些方面表現出色,適合需要復雜數據處理和高數據完整性的項目。

MySQL數據庫的安全可以通過以下措施實現:1.用戶權限管理:通過CREATEUSER和GRANT命令嚴格控制訪問權限。 2.加密傳輸:配置SSL/TLS確保數據傳輸安全。 3.數據庫備份和恢復:使用mysqldump或mysqlpump定期備份數據。 4.高級安全策略:使用防火牆限制訪問,並啟用審計日誌記錄操作。 5.性能優化與最佳實踐:通過索引和查詢優化以及定期維護兼顧安全和性能。

如何有效監控MySQL性能?使用mysqladmin、SHOWGLOBALSTATUS、PerconaMonitoringandManagement(PMM)和MySQLEnterpriseMonitor等工具。 1.使用mysqladmin查看連接數。 2.用SHOWGLOBALSTATUS查看查詢數。 3.PMM提供詳細性能數據和圖形化界面。 4.MySQLEnterpriseMonitor提供豐富的監控功能和報警機制。

MySQL和SQLServer的区别在于:1)MySQL是开源的,适用于Web和嵌入式系统,2)SQLServer是微软的商业产品,适用于企业级应用。两者在存储引擎、性能优化和应用场景上有显著差异,选择时需考虑项目规模和未来扩展性。

在需要高可用性、高級安全性和良好集成性的企業級應用場景下,應選擇SQLServer而不是MySQL。 1)SQLServer提供企業級功能,如高可用性和高級安全性。 2)它與微軟生態系統如VisualStudio和PowerBI緊密集成。 3)SQLServer在性能優化方面表現出色,支持內存優化表和列存儲索引。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

SublimeText3 Linux新版
SublimeText3 Linux最新版

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

Atom編輯器mac版下載
最受歡迎的的開源編輯器

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中