1.installation
2.setup Environment variables
Add%/mysql server/bin to path.
Then restart Cmd/powershell
3.invoking MySQL Programs
Command interpreter represents with Shell>
Enter the program name followed by any options or other arguments.
Shell> is not part of the input
About options:
1. Parameters also single or double dash start to specify program options. After the abbreviation short form, double followed by full write long form.
Abbreviations in the middle with a space or not even spaces, the middle of the full name equals sign.
2.option Case Sensitive-V for--verbose and-v for--version.
3. Some options are followed by option names, such as-h localhost or--host=localhost
The particularity of 4.password
5. Within option names, Dash ( - ) and underscore ( _ ) may be used interchangeably. For example, and is --skip-grant-tables --skip_grant_tables equivalent. (however, the leading dashes cannot be given as underscores.)
6.Numeric value can be represented with K,m,g 1024,1024^2,1024^3
e.g. Mysqladmin--count=1k--sleep=10 Ping
K can be lowercase k.
7. Values that contain spaces must be enclosed in quotation marks.
There are several ways to specify options for MySQL programs:
A) List the options on the command line following the program name. This was common for options, the apply to a specific invocation of
tions the highest.
4.reset Password
The official website tutorial is more detailed.
Https://dev.mysql.com/doc/mysql-windows-excerpt/8.0/en/resetting-permissions-windows.html
Perhaps for security reasons, Google has several methods, either for the old version, or for the forgotten password to change the password.
If you know the password or no password, it is easier to change the password to another or null.
Assume that the environment variable is configured, otherwise it needs to be started in cmd in the bin directory of server 8.0.
Direct Shell>mysql-u root[or username if changed] [-p] (if set PWD) log in.
Then enter in the console:
ALTER USER ' root ' @' localhost ' identified by ' Mynewpass ';
If Mynewpass is empty, there is no password.
ALTER USER [email protected]localhost identified by ' Mynewpass ';
is also equivalent.
MySQL Official Tutorial