Yum-style installation MySQL and common operations summary

Source: Internet
Author: User

1. Installation

Yum-y install MySQL mysql-devel mysql-server add boot entry chkconfig--add mysqld join boot start chkconfig mysqld on

2. Set the root password

Mysqladmin-uroot password "123456"

3. Enter the database

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/C9/wKioL1ZcVc3TeM4pAAMvwHBJRb0854.jpg "title=" 222222.jpg "alt=" Wkiol1zcvc3tem4paamvwhbjrb0854.jpg "/>

4. View the database

Mysql> Show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Test |+--------------------+3 rows in Set (0.00 sec)

Database directory is/var/lib/mysql/

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/CA/wKiom1ZcVjOyPYhxAAIb7UU6f_4053.jpg "title=" 1111111.jpg "alt=" Wkiom1zcvjoypyhxaaib7uu6f_4053.jpg "/>

5. Change your password

The original password is 123456

Law One:

$mysqladmin-uroot-p123456 Password "654321" $mysql-uroot-p654321-s && echo $?mysql> mysql> \q0

Law II:

mysql> Update Mysql.user Set Password=password ("654321") where user = ' root ' and host = ' localhost ';mysql> flush pri  Vileges; Be sure to refresh the permissions, or the original password query OK, 0 rows Affected (0.00 sec)

6. Authorizing remote administrative users

Mysql> Grant All on * * to ' admin ' @ '% ' identified by ' admin ' with grant option;mysql> flush privileges; Refresh the permissions so that they take effect. Query OK, 0 rows Affected (0.00 sec)


Yum-style installation of MySQL and common operations summary

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.