MySQL Password initialization

Source: Internet
Author: User

Original http://blog.csdn.net/firefoxbug/article/details/7931730 installation Mysql[[email protected] ~]# yum-y install mysql-server← Installation Mysql[[email protected] ~]# yum-y install php-mysql← installation php-mysql configuration Mysql[[email protected] ~]#/etc/init.d/mysqld Stop stop MySQL service [[email protected] ~]# vim/etc/my.cnf mysql service configuration file

[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Disabling Symbolic-links is recommended to prevent assorted security risks
Skip-grant-tables #添加这句话, you don't need a password when you log in to MySQL.
Symbolic-links=0

[[email protected] ~]#/etc/init.d/mysqld start MySQL service

[[email protected] ~]# mysql log in to MySQL

mysql> use MySQL;

mysql> UPDATE user SET Password = Password (' New-password ') WHERE user = ' root ';

mysql> flush Privileges;

Mysql> quit

The/ETC/MY.CNF is Skip-grant-tables annotated and the configuration file is restored as is.

[[email protected] ~]#/etc/init.d/mysqld restart start MySQL service

[[email protected] ~]# mysql-u root-p Enter password

Change Password

Original account: root, Password: root, change to fire

[Email protected] ~]# mysqladmin-u root-p password fire

Enter Password:

MySQL Password initialization

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.