首先说一下,在CentOS7下,用yum安装的mysql都变成了mariaDB,最开始我还怕phpmyadmin不支持maria,后来网上一查是支持的。
首先说一下,在CentOS7下,用yum安装的mysql都变成了mariaDB,最开始我还怕phpmyadmin不支持maria,后来网上一查是支持的。
那么话不多说,首先是安装php、apache服务器(httpd)和phpmyadmin,因为这个比较简单嘛。
那么在我现在这个时间点,yum安装出的php版本是5.4的。这个可以安装以后通过rpm -qa|grep php查看。
而在我这个时间点,最新版本的phpmyadmin需要php5.5+的版本,于是乎,要下载一个稍微旧一点的版本。这个在官网上都有。
httpd安装以后,配置文件是/etc/httpd/conf/httpd.conf,而根目录并不是网上说的/var/www/而是/var/www/html/,所以把下载好并且解压过的phpmyadmin文件夹放于此处,然后改个方便的名字便于访问。我在此将文件夹名字改成phpmyadmin。然后执行service httpd start。好你是不是以为可以访问phpmyadmin了?
当然不能访问,会提示你403forbidden,这个时候,要去刚刚说的配置文件里修改,将你看到的
AllowOverride none
Require all denied
改为
AllowOverride none
Order allow,deny
Allow from all
然后保存退出,重启service httpd restart。浏览器里再打开localhost/phpmyadmin,如果你发现有selinux干扰你,你就执行sentenforce 0就好了。
当然也有可能提示你缺少mbstring。这个只需要yum install php-mbstring就好了。
那么再来说说mariaDB,首先通过yum install mysql,自动装上mariaDB而不是mysql。
装好以后,尝试service mariadb start好像不管用,其实在centOS7下命令应该是systemctl start mariadb.service。那么你发现其实还是开启不起来?
好吧你应该检查下你的mariaDB有没有装齐全,rpm -qa|grep mariadb看一下。我当时居然只装了可怜的两个包,事实上需要装8个包:
mariadb-libs-5.5.44-1.el7_1.x86_64
mariadb-embedded-5.5.44-1.el7_1.x86_64
mariadb-5.5.44-1.el7_1.x86_64
mariadb-bench-5.5.44-1.el7_1.x86_64
mariadb-embedded-devel-5.5.44-1.el7_1.x86_64
mariadb-devel-5.5.44-1.el7_1.x86_64
mariadb-test-5.5.44-1.el7_1.x86_64
mariadb-server-5.5.44-1.el7_1.x86_64
版本号随你装的版本而改变。如果你发现没装的,你就挨个yum install吧。。。(其实我个人觉得test是不是可以不装,但是完整的数据库好像都有test)
装好啦,再次systemctl start mariadb.service,你会发现为什么还是不行!
其实是没有指定数据库的存放位置和名字啦,执行命令:mysql_install_db --datadir="/var/lib/mysql" --user="mysql"
指定以后好像终于可以了。但是在第一次时候别忘了给你的root定个密码:mysqladmin -u root password '1234'
这下子是真的大功告成了。可以用刚设置的root和密码登陆phpmyadmin了。彻底完成。
查看mariadb运行状态可以用systemctl status mariadb.service
结果如下:
Linux系统教程:如何检查MariaDB服务端版本
MariaDB Proxy读写分离的实现
Linux下编译安装配置MariaDB数据库的方法
CentOS系统使用yum安装MariaDB数据库
安装MariaDB与MySQL并存
Ubuntu 上如何将 MySQL 5.5 数据库迁移到 MariaDB 10
[翻译]Ubuntu 14.04 (Trusty) Server 安装 MariaDB
MariaDB 的详细介绍:请点这里
MariaDB 的下载地址:请点这里

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,idealforconsistentlengthdatalikecountrycodes;2)VARCHARforvariable-lengthstrings,suitableforfieldslikenames;3)TEXTtypesforlargertext,goodforblogpostsbutcanimpactperformance;4)BINARYandVARB

TomasterMySQLBLOBs,followthesesteps:1)ChoosetheappropriateBLOBtype(TINYBLOB,BLOB,MEDIUMBLOB,LONGBLOB)basedondatasize.2)InsertdatausingLOAD_FILEforefficiency.3)Storefilereferencesinsteadoffilestoimproveperformance.4)UseDUMPFILEtoretrieveandsaveBLOBsco

BlobdatatypesinmysqlareusedforvoringLargebinarydatalikeImagesoraudio.1) Useblobtypes (tinyblobtolongblob) Basedondatasizeneeds. 2) Storeblobsin Perplate Petooptimize Performance.3) ConsidersxterNal Storage Forel Blob Romana DatabasesizerIndimprovebackupupe

ToadduserstoMySQLfromthecommandline,loginasroot,thenuseCREATEUSER'username'@'host'IDENTIFIEDBY'password';tocreateanewuser.GrantpermissionswithGRANTALLPRIVILEGESONdatabase.*TO'username'@'host';anduseFLUSHPRIVILEGES;toapplychanges.Alwaysusestrongpasswo

MySQLofferseightstringdatatypes:CHAR,VARCHAR,BINARY,VARBINARY,BLOB,TEXT,ENUM,andSET.1)CHARisfixed-length,idealforconsistentdatalikecountrycodes.2)VARCHARisvariable-length,efficientforvaryingdatalikenames.3)BINARYandVARBINARYstorebinarydata,similartoC


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
