使用系统CentOS 6.2本来已经系统自带安装了mysql 5.1,但是奈何5.1不支持utf8mb4字符集,只能想办法将Mysql升级到5.5。
使用系统CentOS 6.2本来已经系统自带安装了mysql 5.1,但是奈何5.1不支持utf8mb4字符集(详见: ),只能想办法将Mysql升级到5.5。
这果然是一次蛋疼的升级过程。
完整步骤:
1.首先备份数据,虽说成功的升级数据不会丢失,但是保险起见备份下。
sqldump -u xxx -h xxx -P 3306 -p --all-databases > databases.sql
最好连数据文件和配置文件也备份一份。
cp -R /data/mysql mysql-5.1-data
cp /etc/my.cnf my.cnf-5.1
备份完之后停止mysql服务。
service mysqld stop
好了,开始进入正题。
2.卸载旧版本的Mysql
yum remove mysql mysql-*
执行之后再看看是不是残余一些mysql-libs之类的
yum list installed | grep mysql
如果有,并确认没用之后也可以删除。
yum remove mysql-libs
注意删除mysql-libs可能会对一些依赖软件产生影响,这里我们不讨论。
好了,卸载的动作基本结束。
3.安装Mysql5.5
如果你不偷懒,那么选择编译安装可能会更好,可以参考:
这里我们讨论使用yum安装的过程。
在走了N多弯路之后我发现需要首先安装一些新的repo。
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
这个时候你再运行:
yum --enablerepo=remi,remi-test info mysql mysql-server
就会发现mysql的版本已经是5.5.x了。毫不犹豫安装之。
yum --enablerepo=remi,remi-test install mysql mysql-server
安装到此结束。接下来是启动和升级。
4.启动和升级
这个时候你想直接启动十有八九会报错,主要的问题两块:一是配置文件,,5.5相比5.1有些配置改名了,这个需要你对照启动错误日志一点点改进。二是没有执行mysql_upgrade。
在确保配置文件没问题之后运行:
mysql_upgrade -u root -p
等他全部ok。
再试试运行mysql。
service mysqld start
希望上帝保佑你看到的是绿色的[ok]。
如果你需要从CentOS 5上升级Mysql那么你可以参考: ,但是注意这个只适用于CentOS 5,我一开始就是被这个误导了耽误了半天时间。

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters


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

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

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

Notepad++7.3.1
Easy-to-use and free code editor
