The latest version of MySQL under CentOS finally installs successfully! Back up a few key places.

Source: Internet
Author: User
Tags mysql in

I was just trying to build a simple lamp environment, but I found that there were so many problems. (by default7#zbphp.com)


A lot of places to install the MySQL hint is via yum one click Install. The shell command is as follows:

Yum Install Mysqlyum install Mysql-serveryum install Mysql-devel


However, this command installs the MySQL version is very old , 5.1.0x version of, the official website MySQL already is the 5.6.x version. It's too old to remember the 5.1 version in 08.

Adhere to the latest version of the installation, the MySQL official website Download Rpm-.tar installation package, about 300MB. Linux64.



But follow the online (csdn blog, BLOGCN blog) step-by-step instructions to install but always a variety of problems, problems, can not run.

Finally tried a lot of times finally installed successfully, normal operation:

[[email protected]/]# yum remove mysqlloaded plugins:fastestmirror, Refresh-packagekit, securitysetting up remove Processno Match for argument:mysqlloading mirror speeds from cached Hostfile * base:mirrors.163.com * extras:mirrors.16 3.com * Updates:mirrors.163.compackage (s) MySQL available, but not installed. No Packages marked for removal[[email protected]/]# yum remove mysql-serverloaded plugins:fastestmirror, refresh-p Ackagekit, securitysetting up Remove processresolving dependencies--> Running Transaction Check---> Package Mysql-server.x86_64 0:5.6.19-1.linux_glibc2.5 'll be erased--> finished Dependency resolutiondependencies Resolved                        ================================================================================ Package Arch Version Repository Size================================================================================remov Ing:mysql-server x86_64 5.6.19-1.linux_glibc2.5 installed 248Mtransaction Summary================================================================================remove 1 Package (s) installed size:248 MIs this OK [y/n]: ydownloading packages:running rpm_check_debugrunning Transaction Testtra   Nsaction Test succeededrunning Transaction erasing:mysql-server-5.6.19-1.linux_glibc2.5.x86_64 1/1 verifying:mysql-server-5.6.19-1.linux_glibc2.5.x86_64 1/1 removed:mysql-server.x86_64 0:5.6.19-1.L inux_glibc2.5 complete! [[email protected]/]# yum remove mysql-*loaded plugins:fastestmirror, Refresh-packagekit, securitySetting up Remove processresolving dependencies--> Running Transaction Check---> Package mysql-devel.x86_64 0:5.6.19-1. linux_glibc2.5 'll be erased---> Package mysql-shared.x86_64 0:5.6.19-1.linux_glibc2.5 'll be erased---> package Mysql-shared-compat.x86_64 0:5.6.19-1.linux_glibc2.5 'll be erased--> processing Dependency:libmysqlclient.so.16 () (64bit) for package:perl-dbd-mysql-4.013-3.el6.x86_64--> processing dependency:libmysqlclient.so.16 ( LIBMYSQLCLIENT_16) (64bit) for package:perl-dbd-mysql-4.013-3.el6.x86_64--> Running transaction Check---> Package perl-dbd-mysql.x86_64 0:4.013-3.el6 'll be erased--> finished Dependency resolutiondependencies Resolved===                 ============================================================================= Package Arch Version Repository size================================================================================removing : Mysql-devel x86_64 5.6.19-1.linux_glibc2.5 installed M mysql-shared x86_64 5.6.19-1.linux                                                                          _glibc2.5 @/mysql-shared-5.6.19-1.linux_glibc2.5.x86_64                                                      7.8 M mysql-shared-compat x86_64 5.6.19-1.linux_glibc2.5 @/mysql-shared-compat-5.6.19-1.linux_glibc2.5.x86_64                     Mremoving for Dependencies:perl-dbd-mysql x86_64 4.013-3.el6 @base  338 Ktransaction Summary================================================================================remove 4 Package (s) installed size:36 MIs this OK [y/n]: ydownloading packages:running rpm_check_debugrunning Transaction Testtran   Saction Test succeededrunning Transaction erasing:mysql-devel-5.6.19-1.linux_glibc2.5.x86_64 1/4 Erasing:perl-dbd-mysql-4.013-3.el6.x86_64 2/4 erasing:mysql-shared-compat-5.6.19-1 . linux_glibc2.5.x86_64 3/4 erasing:mysql-shared-5.6.19-1.linux_glibc2.5.x86_64 4/4 Ver Ifying:mysql-shared-compat-5.6.19-1.linux_glibc2.5.x86_64 VERIFYING:MYSQL-DEVEL-5.6.19-1.LINUX_GLIBC 2.5.x86_64 2/4 verifying:mysql-shared-5.6.19-1.linux_glibc2.5.x86_64 3/4 verifyi ng:perl-dbd-mysql-4.013-3.el6.x86_64 4/4 removed:mysql-devel.x86_64 0:5.6.19-1.linux_glibc2.5 mysql-shared.x86_64 0:5.6.19-1.linux_glibc2.5 mysql-shared-compat.x86_64                                           0:5.6.19-1.linux_glibc2.5 Dependency removed:perl-dbd-mysql.x86_64 0:4.013-3.el6 complete! [[email protected]/]# yum remove mysql-*loaded plugins:fastestmirror, Refresh-packagekit, securitySetting up Remove Processno Match for argument:mysql-*loading mirror speeds from cached Hostfile * base:mirrors.163.com * extras:m Irrors.163.com * Updates:mirrors.163.compackage (s) mysql-* available, but not installed. No Packages marked for removal[[email protected]/]# whereis mysqlmysql:/usr/lib64/mysql[[email protected]/ ]# which mysql/usr/bin/which:no MySQL in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/ Default7/bin) [[email protected]/]#Yum Remove mysql-sharedloaded plugins:fastestmirror, Refresh-packagekit, securitysetting up remove Processno Match for AR Gument:mysql-sharedloading mirror speeds from cached Hostfile * base:mirrors.163.com * extras:mirrors.163.com * Updates : Mirrors.163.comno Packages marked for removal[[email protected]/]# whereis mysqlmysql:/usr/lib64/mysql[[email& Nbsp;protected]/]# which mysql/usr/bin/which:no MySQL in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/ Sbin:/home/default7/bin) [[email protected]/]# yum remove mysql-testloaded plugins:fastestmirror, Refresh-packagekit, securitysetting up Remove Processno Match for argument:mysql-testloading mirror speeds from cached ho  Stfile * base:mirrors.btte.net * extras:mirrors.btte.net * updates:mirrors.btte.netPackage (s) mysql-test available, but Not installed. No Packages marked for removal[[email protected]/]# clear


In fact, I have been constantly re-install, always problem, unable to start or error, the reason in the first installation step is not correct, and then continue to reload.

But not completely uninstalled cleanly . Rpm-e MySQL This seems to be case-sensitive, and I started to delete the folder directly to uninstall, and later with Rpm-e-nodeps Mysql to uninstall, but still have residue.

Finally, use the Yum remove MySQL, mysql-server,mysql-shared to uninstall, in order to uninstall clean, then, all the folders have MySQL deleted. and then reinstall it.

[[email protected] mysqlinstall]# lsmysql-client-5.6.19-1.linux_glibc2.5.x86_64. Rpmmysql-devel-5.6.19-1.linux_glibc2.5.x86_64.rpmmysql-embedded-5.6.19-1.linux_glibc2.5.x86_64. Rpmmysql-server-5.6.19-1.linux_glibc2.5.x86_64.rpmmysql-shared-5.6.19-1.linux_glibc2.5.x86_64. Rpmmysql-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpmmysql-test-5.6.19-1.linux_glibc2.5.x86_64.rpm[[email  protected] mysqlinstall]# rpm-ivh mysql-server-*.rpmpreparing ... ################################### ######## [100%] 1:mysql-server ########################################### [100%][[email protected] MySQL install]# rpm-ivh mysql-client-*.rpmpreparing ... ########################################### [100%] 1:My Sql-client ########################################### [100%][[email protected] mysqlinstall]# RPM-IVH MyS Ql-devel-*.rpmpreparing ########################################### [100%] 1:mysql-devel # # ######################################### [100%][[email protected] mysqlinstall]# service MySQL status ERROR! MySQL is not running[[email protected] mysqlinstall]# service MySQL startstarting MySQL.  success!



Modify the settings password, the original password in/root/This folder, Ls-a can see a MySQL file, which has the original password:

mysql> show databases; ERROR 1820 (HY000): Must SET PASSWORD before executing this statementmysql> select User (); ERROR 1820 (HY000): Must set PASSWORD before executing this statementmysql> set Password=password (' zbphp.com '); Query OK, 0 rows Affected (0.00 sec) mysql> Show user (); Error 1064 (42000): You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ' user () ' at line 1mysql&gt ; Select User (); +----------------+| User () |+----------------+| [Email protected] |+----------------+1 row in Set (0.00 sec) mysql> Show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Performance_schema | | Test |+--------------------+4 rows in Set (0.01 sec) mysql> Select version (); +-----------+| Version () |+-----------+| 5.6.19 |+-----------+1 row in Set (0.00 sec) mysql>



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.