Mysql installation and root Password Initialization

Source: Internet
Author: User
Tags mysql login


Install mysql [root @ sample ~] # Yum-y install mysql-server Plugin install MySQL [root @ sample ~] # Yum-y install php-mysql plugin install php-mysql configure mysql [root @ sample ~] #/Etc/init. d/mysqld stop mysql service [root @ sample ~] # Vim/etc/my. cnf mysql service configuration file [mysqld] www.2cto.com datadir =/var/lib/mysqlsocket =/var/lib/mysql. sockuser = mysql # Disabling symbolic-links is recommended to prevent assorted security risksskip-grant-tables # Add this sentence, at this time, you do not need to log on to mysql with the password symbolic-links = 0 [root @ sample ~]. #/Etc/init. d/mysqld start mysql service [root @ sample ~] # Mysql login mysqlmysql> USE mysql; mysql> UPDATE user SET Password = password ('new-password') WHERE User = 'root'; mysql> flush privileges; mysql> quit puts/etc/my. in cnf, skip-grant-tables is commented out, and the configuration file is restored as is. Www.2cto.com [root @ sample ~] #/Etc/init. d/mysqld restart start mysql service [root @ sample ~] # Mysql-u root-p Enter Password Change Password original account: root, password: root, change to fire [root @ sample ~] # Mysqladmin-u root-p password fire Enter password:
 

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.