CentOS 6.5上安装MariaDB 作者:chszs,转载需注明。博客主页:http://blog.csdn.net/chszs 1、软件环境: CentOS 6.5 x64 2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下: # MariaDB 5.5 CentOS repository list - created 2014-0
CentOS 6.5上安装MariaDB
作者:chszs,转载需注明。博客主页:http://blog.csdn.net/chszs1、软件环境: CentOS 6.5 x64
2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下:
# MariaDB 5.5 CentOS repository list - created 2014-03-04 11:20 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
# yum install MariaDB-server MariaDB-client Loaded plugins: fastestmirror, security base | 3.7 kB 00:00 base/primary_db | 4.4 MB 01:11 extras | 3.4 kB 00:00 extras/primary_db | 19 kB 00:00 mariadb | 1.9 kB 00:00 mariadb/primary_db | 15 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.1 MB 00:22 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package MariaDB-client.x86_64 0:5.5.36-1.el6 will be obsoleting --> Processing Dependency: MariaDB-common for package: MariaDB-client-5.5.36-1.el6.x86_64 ---> Package MariaDB-server.x86_64 0:5.5.36-1.el6 will be obsoleting ---> Package mysql.x86_64 0:5.1.71-1.el6 will be obsoleted ---> Package mysql-server.x86_64 0:5.1.71-1.el6 will be obsoleted --> Running transaction check ---> Package MariaDB-common.x86_64 0:5.5.36-1.el6 will be installed --> Processing Dependency: MariaDB-compat for package: MariaDB-common-5.5.36-1.el6.x86_64 --> Running transaction check ---> Package MariaDB-compat.x86_64 0:5.5.36-1.el6 will be obsoleting ---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be obsoleted --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================== Package Arch Version Repository Size ================================================================================================================== Installing: MariaDB-client x86_64 5.5.36-1.el6 mariadb 10 M replacing mysql.x86_64 5.1.71-1.el6 MariaDB-compat x86_64 5.5.36-1.el6 mariadb 2.7 M replacing mysql-libs.x86_64 5.1.71-1.el6 MariaDB-server x86_64 5.5.36-1.el6 mariadb 42 M replacing mysql-server.x86_64 5.1.71-1.el6 Installing for dependencies: MariaDB-common x86_64 5.5.36-1.el6 mariadb 23 k Transaction Summary ================================================================================================================== Install 4 Package(s) Total download size: 55 M Is this ok [y/N]: y Downloading Packages: (1/4): MariaDB-5.5.36-centos6-x86_64-client.rpm | 10 MB 04:45 (2/4): MariaDB-5.5.36-centos6-x86_64-common.rpm | 23 kB 00:00 (3/4): MariaDB-5.5.36-centos6-x86_64-compat.rpm | 2.7 MB 01:02 (4/4): MariaDB-5.5.36-centos6-x86_64-server.rpm | 42 MB 17:44 ------------------------------------------------------------------------------------------------------------------ Total 40 kB/s | 55 MB 23:34 warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB Importing GPG key 0x1BB943DB: Userid: "Daniel Bartholomew (Monty Program signing key)
3、启动MariaDB
# /etc/init.d/mysqld start Initializing MySQL database: WARNING: The host 'Cloud-Q2' could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! 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 Cloud-Q2 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 ]
4、为MariaDB设置密码
# /usr/bin/mysqladmin -u root password 'adminadmin'
MySQL [(none)]> use mysql; MySQL [mysql]> update user set host='%' where user='root' and host='127.0.0.1'; MySQL [mysql]> grant all privileges on *.* to 'root'@'%' identified by 'adminadmin' with grant option; MySQL [mysql]> flush privileges;
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
# service iptables restart

如何有效監控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在性能優化方面表現出色,支持內存優化表和列存儲索引。

mySqlManagesCharacterSetsetSandCollationsyutusututf-8asthEdeFault,允許ConfigurationAtdataBase,table和columnlevels,AndrequiringCarefullageLignmentToavoidMismatches.1)setDefeaultCharactersetTercharactersetEtCollacterSeteTandColletationForAdataBase.2)conformentcollecharactersettersetertersetcollatertersetcollationcollation

MySQL觸發器是與表相關聯的自動執行的存儲過程,用於在特定數據操作時執行一系列操作。 1)觸發器定義與作用:用於數據校驗、日誌記錄等。 2)工作原理:分為BEFORE和AFTER,支持行級觸發。 3)使用示例:可用於記錄薪資變更或更新庫存。 4)調試技巧:使用SHOWTRIGGERS和SHOWCREATETRIGGER命令。 5)性能優化:避免複雜操作,使用索引,管理事務。

在MySQL中創建和管理用戶賬戶的步驟如下:1.創建用戶:使用CREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';2.分配權限:使用GRANTSELECT,INSERT,UPDATEONmydatabase.TO'newuser'@'localhost';3.修正權限錯誤:使用REVOKEALLPRIVILEGESONmydatabase.FROM'newuser'@'localhost';然後重新分配權限;4.優化權限:使用SHOWGRA

MySQL適合快速開發和中小型應用,Oracle適合大型企業和高可用性需求。 1)MySQL開源、易用,適用於Web應用和中小型企業。 2)Oracle功能強大,適合大型企業和政府機構。 3)MySQL支持多種存儲引擎,Oracle提供豐富的企業級功能。

MySQL相比其他關係型數據庫的劣勢包括:1.性能問題:在處理大規模數據時可能遇到瓶頸,PostgreSQL在復雜查詢和大數據處理上表現更優。 2.擴展性:水平擴展能力不如GoogleSpanner和AmazonAurora。 3.功能限制:在高級功能上不如PostgreSQL和Oracle,某些功能需要更多自定義代碼和維護。


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

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

熱門文章

熱工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

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

Dreamweaver Mac版
視覺化網頁開發工具

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