Today we will look at the various commands of the database, the following commands are all from the command line under the CMD Command Window input instructions, first if you enter MySQL, the system prompts "MySQL is not an internal command or external command." So this is actually the reason why the environment variable is not set up, for example, my MYSQL installation directory is C:\NEWS\MYSQL, then enter C:\news\mySql\MySQL Server in the system variable path path in the environment variable 5.5\bin , restart cmd, then input MySQL, should be able to operate normally, of course, if the MySQL service to start normally, if not started then CMD will show cannot CONNECT th ....
First, the MySQL statement is case-insensitive. Look at the first command:
mysqladmin-uroot-p123 Password 456
The meaning of this sentence is to change the root password to 456, the original password is 123,-u represents the user name, followed by the root user name,-p means the password after 123 is the login password, the middle of the space can be omitted. However, the space between the password and the new password cannot be omitted.
1.1, connect to the remote database, the basic format is as follows:
Mysql-h Computer name (IP address)-u user name-p password
For example, my database is local, the database IP address is 127.0.0.1, then you can write:
Mysql-h 127.0.0.1-u root-p 123
1.2. mysql Rights Management:
1.3. Add new users
First to log in to the MySQL database, root login after the first select the database and then add new user operations,
>use database_name; Select Database
The following steps are run in conjunction until the end of the semicolon, and the ENTER key does not cause the command to end! is to touch the semicolon press ENTER to indicate the end statement.
>grant All
MySQL command cmd operation