Details of cmd command operations in MYSQL database

  • 2020-12-22 17:49:13
  • OfStack

CMD command

cmd is short for command. The command prompt (CMD) is the "ES16en-ES17en mode" under OS / 2, Windows CE and Windows NT platform-based operating systems (including Windows 2000 and XP, Vista, and Server 2003). The command prompt in The Chinese version of Windows XP improves compatibility with DOS operation commands by allowing users to directly enter a Chinese call file at the command prompt.

Today we will look at the various commands in the database. The following commands are all input from the command line under the CMD command window. First, if you type mysql, the system will say "mysql is not an internal command or an external command. For example, my mysql installation directory is C:\news\mySql, then enter C:\news\mySql\MySQL Server 5.5\bin in the system variable PATH path of the environment variable, restart CMD, then enter mysql again, and it should work normally, provided of course that the mysql service should 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 

This means to change the password of root to 456, the original password is 123, -u for user name, followed by root, -p for 123 for login password, the space in between can be omitted. But the space between password and the new password must not 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, if my database is local and the database ip address is 127.0.0.1, then I can write:


mysql -h 127.0.0.1 -u root -p 123 

1.2 MySQL Permission Management:

1.3. Add new users

First, login to mysql database. After login to root, select the database and then add new users.


>use database_name; // Select database  

The following steps connect the 1 start line until it ends with a semicolon. The enter key does not end the command! To close a statement, press enter when a semicolon is encountered.


>grant all 



Related articles: