早已经安装了Ubuntu 11.04,发现apt-get只能安装 5.1版本的MySQL,要用5.5的话,只能自己动手编译了。编译安装过程记录如下:一、
早已经安装了Ubuntu 11.04,发现apt-get只能安装 5.1版本的MySQL,要用5.5的话,只能自己动手编译了。
编译安装过程记录如下:
一、去mysql.com下载 MySQL 5.5.15 的源代码:
mysql-5.5.15.tar.gz (Generic Linux (Architecture Independent))
二、安装必要的软件:
1. cmake
~$ sudo apt-get install cmake
2. bison
~$ sudo apt-get install bison
三、给MySQL服务器添加用户组和用户名
~$ sudo groupadd mysql
~$ sudo useradd -r -g mysql mysql
四、解压下载后的源代码 (以下载路径 ~/src 为例),编译、安装:
~$ cd src
~/src$ tar -xzf mysql-5.5.15.tar.gz
~/src$ cd mysql-5.5.15
~/src/mysql-5.5.15$ cmake .
~/src/mysql-5.5.15$ make
~/src/mysql-5.5.15$ sudo make install
如果以上命令都没有报错,表示编译、安装成功,默认安装到 /usr/local/mysql.
继续以下命令,完成安装:
~/src/mysql-5.5.15$ cd /usr/local
/usr/local$ sudo chown -R mysql.mysql mysql
/usr/local$ sudo ln -s /usr/local/mysql/bin/* /usr/bin
/usr/local$ sudo ln -s /usr/local/mysql/share /usr/share/mysql
如果要使用MySQL进行二次开发:
/usr/local$ sudo ln -s /usr/local/mysql/include /usr/include/mysql
/usr/local$ sudo ln -s /usr/local/mysql/lib/* /usr/lib/
回到初始路径后运行:
~$ mysql --version
mysql Ver 14.14 Distrib 5.5.15, for Linux (i686) using EditLine wrapper
表示mysql客户端已经可以正常使用了。
五、配置MySQL Server:
~$ sudo install -m644 /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
(注:根据实际需要选择my-medium.cnf 或者my-large.cnf, my-huge.cnf)
~$ sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
~$ sudo install -m755 /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
编辑/etc/my.cnf, 在[mysqld]下面增加 datadir = /var/lib/mysql , 然后启动 MySQL server:
~$ sudo /etc/init.d/mysqld start
如果以上命令没有报错,,则表示MySQL 5.5.15 的服务器已经安装成功。先设置root密码:
~$ mysqladmin -u root password
~$ mysql -u root -p
通过修改 /etc/my.cnf 来完成进一步的配置。

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

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.

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.

SublimeText3 Chinese version
Chinese version, very easy to use

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download
The most popular open source editor
