CentOS6.5 the MySQL initial password through shell, turn on remote login, authorize Telnet user

Source: Internet
Author: User

CentOS6.5 under the shell to modify the MySQL initial password, open remote login, authorized Telnet users;

Recently writing a shell script for an automated deployment, you need to modify the MySQL initial password through the shell, turn on remote logins, authorize Telnet users,

After some search and experiment, get the following several commands to share with you:


To modify the initial password:
MYSQLADMIN-UROOT-PVYCE2UWSAQX3XOFR password "123456"


Enable remote login to authorize Telnet users:
MYSQL-UROOT-PROOT-E "Grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT option;"


To make an authorization effective immediately:
MYSQL-UROOT-PROOT-E "flush privileges;"

CentOS6.5 the MySQL initial password through shell, turn on remote login, authorize Telnet user

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.