Apply MySQL (installed in Linux)

Source: Internet
Author: User
Tags gpg mysql version

The current MySQL website installation tutorial indicates that you can use the Yum method.

MySQL YUM Repository

MySQL Yum library provides rpm installation packages for MySQL clients, servers, and related components

The library can also upgrade and replace third-party MySQL installed (from Linux native software sources), if any

Supported Linux platforms:

  • EL5,EL6,EL7-based Linux platforms, such as the associated version of Red Hat,centos,oracle Linux
  • Fedora 20
View Linux version, download the corresponding version of MySQL Yum Library
[root@localhost ~]# uname -r3.10.0-123.el7.x86_64

Open URL, http://dev.mysql.com/downloads/repo/yum/

Determine the Linux version corresponding to the MySQL Yum library

Download using wget

Install MySQL Yum Repository
[root@localhost ~]# rpm -Uvh platform-and-version-specific-package-name.rpm
Set up MySQL Yum Repository

Modify the file/etc/yum.repos.d/mysql-community.repo to determine the MySQL version used

# Enable to use MySQL 5.6[mysql56-community]name=MySQL 5.6 Community Serverbaseurl=//repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/enabled=1gpgcheck=1gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Each MySQL version of the above content has

To use this version of MySQL, set enable to 1

Note that the other versions are set to 0

Once setup is complete, use the following command to view the MySQL version used

| grep mysql
Installing MySQL Server
install mysql-community-server
Start MySQL

Start

service mysqld start

View status

service mysqld status

Stop it

service mysqld stop
To set the root user password

After installation, the Superuser does not have a password

This causes anyone to log on to MySQL as long as it is on the local computer

Set the password for security reasons

[[email protected] ~]# mysql -u rootmysql> SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘newpwd‘);mysql> SET PASSWORD FOR ‘root‘@‘127.0.0.1‘ = PASSWORD(‘newpwd‘);mysql> SET PASSWORD FOR ‘root‘@‘::1‘ = PASSWORD(‘newpwd‘);mysql> SET PASSWORD FOR ‘root‘@‘host_name‘ = PASSWORD(‘newpwd‘);

Or

shell> mysql -u rootmysql> UPDATE mysql.user SET Password = PASSWORD(‘newpwd‘) WHERE User = ‘root‘;mysql> FLUSH PRIVILEGES;

View MySQL password settings

User,Host, Password FROM mysql.user;

For more user permission settings see: http://dev.mysql.com/doc/refman/5.6/en/default-privileges.html

Reference

MySQL 5.6 version, installing MySQL on Linux Using the MySQL Yum Repository

Apply MySQL (installed in Linux)

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.