Binary installation MySQL-5.5.33

Source: Internet
Author: User

Binary installation MySQL is very convenient, compared to compile installation, the drawback is that the installation package is too large. Ha ha

Start the installation, first develop a good habit, create a directory dedicated to the installation package

Mkdir-p/home/yuci/tools

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/ Wkiom1h-4sprtit4aaajcjp8qv0090.png "" 353 "height="/>

Installation Lrzsz can be dragged to the specified directory directly under Xshell

Yum-y Install Lrzsz

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/F1/ Wkiom1h-4ssyuuieaaah1f5-g-4869.png "" 322 "height=" "/>

Drag and drop the MySQL installer into the/home/yuci/tools directory, and the decompression will be OK.

cd/home/yuci/tools/

Tar zxf mysql-5.5.33-linux2.6-x86_64.tar.gz

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/ Wkiom1h-4swcyktyaaanz0tnwds199.png "" 541 "height=" 104 "/>

Create a MySQL user and check

Useradd-s/sbin/nologin/-M MySQL

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/EE/ Wkiol1h-4sxrwodlaaack_gjhvc204.png "" 453 "height="/>

Create a MySQL real installation directory again, before that is the directory where the installation package is stored

Mkdir/application

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/EE/wKioL1h-4SWgdI_ Kaaaiyuy-boc091.png "" "height=" "/>"

Move the extracted MySQL to the/application directory and keep the version number

MV mysql-5.5.33-linux2.6-x86_64/application/mysql-5.5.33

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/F1/ Wkiom1h-4srbh27iaaau_rxuwfi152.png "" 637 "height="/>

Creating a soft connection with no version number to MySQL

Ln-s/application/mysql-5.5.33//application/mysql

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/ Wkiom1h-4srhnm2yaaajzbq3-ia972.png "" 630 "height="/>

Initialize MySQL, see two OK instructions so far the installation configuration of MySQL is normal

/application/mysql/scripts/mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/data/-- User=mysql

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/EE/ Wkiol1h-4svcikmraabofw45sxy864.png "" 656 "height=" 214 "/>

Authorizing MySQL Users

Chown-r Mysql:mysql/application/mysql

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/F1/ Wkiom1h-4sytn3y9aaaliidwm2y484.png "" 495 "height=" "/>

Copy the MySQL configuration file, my.cnf

Cp/application/mysql/support-files/my-small.cnf/etc/my.cnf

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/ Wkiom1h-4szcqodtaaaszj6t_i4279.png "" 661 "height="/>

Mysqld_safe is the MySQL startup script, the default MySQL installation location is/usr/local/mysql, but our installation path is/application/mysql, so we need to change through SED

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/F1/ Wkiom1h-4s2aq9vtaaaq-0rsr8a201.png "734" height= "Max"/>

Try to start MySQL and put it in the background execution

/application/mysql/bin/mysqld_safe &

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/EE/ Wkiol1h-4s2azgceaaalopeggog704.png "" 487 "height="/>

Check MySQL port 3306 to see if MySQL is booting

Lsof-i: 3306

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/F1/ Wkiom1h-4s7jtii2aaawe-fmydw065.png "" 566 "height=" "/>

Now MySQL is up, but you also need to configure environment variables to log in to MySQL

Vim/etc/profile

Path= "/application/mysql/bin: $PATH"

Source/etc/profile

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/EE/ Wkiol1h-4s6hesd4aaaigo1atcg385.png "" 306 "height="/>

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/F1/ Wkiom1h-4s-zck7zaaaleo2aqj8085.png "" 340 "height="/>

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/EE/wKioL1h-4S_ Bkfbaaaaixfe9qkq735.png "" 349 "height="/>

Attempt to log on to MySQL successfully

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M01/8C/F1/wKiom1h-4TCh4Dy_ Aabdt_3v4ze551.png "" 648 "height=" 235 "/>

Copy MySQL startup script, modify the installation path inside, add execute permission, easy to restart MySQL

Cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/etc/init.d/mysqld

chmod +x/etc/init.d/mysqld

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/F1/ Wkiom1h-4thzwojlaaaeytmjfpw379.png "" 719 "height="/>

Kill the MySQL process with the killall command until no process is present killed

Killall mysqld

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/F1/ Wkiom1h-4thynuhlaaaqvwypclu683.png "" 733 "height="/>

Check if Port 3306 is turned on by lsof command

Lsof-i: 3306

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/wKiom1h-4TLAoqW_ Aaalzmwh0uw067.png "" 311 "height="/>

Start MySQL with a script that was just copied

/etc/init.d/mysqld start

Lsof-i: 3306

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8C/F1/ Wkiom1h-4tkqmvo5aaaipzghd4w106.png "" 567 "height="/>

Add power-on self-boot to MySQL and check

Chkconfig mysqld on

Chkconfig--list mysqld

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/F1/ Wkiom1h-4tpbld4saaau5exhij0427.png "" 575 "height="/>

Finally, set a password for the MySQL administrator

Mysqladmin-uroot password "123456"

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8C/EE/ Wkiol1h-4tozfaalaaakuoml2hu444.png "" 461 "height="/>

Login successful, MySQL binary installation complete

650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8C/F1/ Wkiom1h-4tsyzeljaabk4mbjqli847.png "" 649 "height=" 244 "/>

Binary installation MySQL-5.5.33

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.