MySQL installation method

Source: Internet
Author: User

It is hereby stated that the specific source of the study in the network above is not clear. If there is infringement please inform the author to revoke, thank you!

MySQL installation method

First, unzip MySQL to the database to install the directory

Second, rename My-default.ini to My.ini and change two of the lines

# Basedir = ...

# DataDir = ...

The following were:

Basedir = D:\Database\MySQL

DataDir = D:\Database\MySQL\data

Save and copy to the bin directory of the database directory next copy

To run command-line tools with administrator privileges, switch to the bin directory of the database directory to enter commands

Mysqld--defaults-file=d:\database\mysql\bin\my.ini--initialize

See if the data directory is generated and the contents are then run

Mysqld--install Install the database, and then run

net start MySQL startup database service

Installation is complete.

The Administrator account is: The root password is: null

MySQL Password modification (recommended to use the 3rd method to log in to MySQL and then change the password modified more comprehensive):

To modify a password using the DOS command line:

Format: Mysqladmin-u username-P Old password password new password

1, add a password to root ab12. First enter the bin directory of the database directory under DOS, and then type the following command

Mysqladmin-u root-p * * * Password AB12

Note: Randomly generated passwords are viewed in the Xxx.err file in the data directory

Note: If Root does not have a password, then the old password after-p can be omitted.

(If the configuration environment variable is not in the bin directory of the database directory)

(New variable: variable name: mysql_home; Variable value: Database directory )

(Modify the PATH variable: append "; database directory \ Bin" with the semicolon as the English half-width character)

2, then change the root password to djg345.

Mysqladmin-u root-p ab12 Password djg345

(Note: Unlike the above, the following is because it is a command in a MySQL environment, so it is followed by a semicolon as a command terminator)

3, the command line to modify the root password:

DOS input mysql-u root-p login to MySQL root account

mysql> UPDATE mysql.user SET password=password (' password ') WHERE user= ' root ';

mysql> FLUSH privileges;

mysql> ALTER USER ' jeffrey ' @ ' localhost ' identified by ' new_password ' password EXPIRE;

Note: MySQL 5.7 adds two fields password_last_changed, password_lifetime to refine the security policy.

4. Display the current User:

Mysql> SELECT USER ();

MySQL installation method

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.