Installation and configuration of the CentOS cloud server MySQL

Source: Internet
Author: User

1. Install MySQL

#yum-y Install Mysql-server

2. Set self-start and start MySQL

Set up MySQL service to boot from system startup

#chkconfig mysqld on

Confirm MySQL self-boot (ok if 2--5 is on)

#chkconfig--list mysqld

Start the MySQL service

#/etc/rc.d/init.d/mysqld start

3. Set password (default root user does not set password)

Log in to MySQL

#mysql-U Root

Switch Database (MySQL)

>use MySQL

View user Information

>select User,host,password from user;

Set Password

>set password for [email protected]=password (' root ');

Quit MySQL

>exit

Login with username and password

#mysql-U root-p

Then output the password to enter

Settings allow the extranet IP to access MySQL

>update user set host= '% ' where user= ' root ';

>flush privileges;

Authorizing the root user to connect to the MySQL server from any host using a password

>grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;

>flush privileges;

Installation and configuration of the CentOS cloud server 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.