Rpm/yum installation of MySQL

Source: Internet
Author: User
Tags mysql in




My installation environment for centos6.4 MySQL-related packages by www.mysql.com

dev.mysql.com Download




Install MySQL in RPM package:

[Email protected] ~]# wget http://dev.mysql.com/get/downloads/mysql-5.6/mysql-5.6.30-1.el6.x86_64.rpm-bundle.tar[ [Email protected] ~]# lsmysql-5.6.30-1.el6.x86_64.rpm-bundle.tar[[email protected] ~]# tar xvf mysql-5.6.30-1.el6.x86_ 64.rpm-bundle.tar-c/usr/src/mysql/[[email protected] ~]# cd/usr/src/mysql/[[email protected] mysql]# RPM-IVH MYSQL-CL  ient-5.6.30-1.el6.x86_64.rpm mysql-devel-5.6.30-1.el6.x86_64.rpm mysql-server-5.6.30-1.el6.x86_64.rpm # Use RPM package to pay attention to the dependency relationship error is basically a package dependency problem install the appropriate package to resolve dependencies based on the error message




Install MySQL based on the official Yum Source:

[[email protected] ~]# wget Http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm[[email protected] ~] # Lsmysql57-community-release-el6-8.noarch.rpm[[email protected] ~]# RPM-IVH MYSQL57-COMMUNITY-RELEASE-EL6-8.NOARCH.RPM # automatically configures the Yum source for us [email protected] ~]# Yum install mysql-client my Sql-server # Installing MySQL


You can also build your own MySQL yum source.

How to build Yum source see http://11427860.blog.51cto.com/11417860/1769560


[[email protected] ~]# Vim/etc/yum.repos.d/mysql-community.repo # There are MySQL versions of the source address from the inside copy out of their own build MySQL yum source





To start the MySQL service:

[[email protected] ~]#/etc/init.d/mysql start

Or

[[Email protected] ~]# service MySQL start



To view the MySQL initial password:

[Email protected] ~]# Cat/root/.mysql_secret

MySQL will generate a random initial password at the beginning of the MySQL5.6 version, and the password is in/root/.mysql_secret

Before MySQL5.6 the version is blank password by default, can log in directly



[[email protected] ~]# mysql_secure_installation#  after entering the initial password   change the root password? [y/n]  y  #  lose  y   Create a new  root Password ... remove anonymous users? [y/n]  y   #  lose  y   Remove anonymous users #  mysql installation is complete, the default is to install an anonymous user, the anonymous user is used for testing, allowing anyone to log in from anywhere to MySQL, but can not do other things, this is a security risk, delete it. ... disallow root login remotely? [y/n]  y  #  The root user is not allowed to log in from a distance to this machine, Generally in the production environment   choose  y  To improve security, if you want to log in to MySQL with the root user, you will often use SSH to log in remotely to that specific MySQL server, and then log in with the root user of MySQL locally on that server. ... remove test database and access to it? [y/n]  y  #   Whether to remove  test database    output  y  Remove the MySQL installation will create a test library by default, which can be accessed by anyone, and this library is for testing. ... reload privilege tables now? [y/n]  y  #  Transmission  y  Let the authorization changes just for MySQL take effect immediately ...                         #  And then it's almost logged into MySQL.


Log in to MySQL

[[email protected] ~]# mysql-uroot-p ' password ' mysql> mysql>set passwrd = PASSWORD (' newpasswd '); Set a new password



If you cannot find the initial password or forget the root password, you can reset the root password by doing the following:


Modify the MySQL configuration file (default is/ETC/MY.CNF)

[[email protected] ~]# VIM/ETC/MY.CNF # Add a line under [Mysqld] Skip-grant-tables


Restart MySQL Service

[[Email protected] ~]# service restart MySQL


You can now go directly to MySQL without a password

mysql> Update Mysql.user Set Authentication_string=password (' NewPassword '), where user= ' root ' and host= '   localhost '; # Reset root password mysql> flush privileges;mysql> quit;


Restore/ETC/MY.CNF, restart the MySQL service, log in to MySQL with Mysql-uroot-p ' newpassword '





Installing MySQL with the official RPM pack and Yum is characterized by simple speed, but no custom installation, and a primer.




This article is from the "11417860" blog, please be sure to keep this source http://11427860.blog.51cto.com/11417860/1769851

Rpm/yum installation of MySQL

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.