CMD command
CMD is the abbreviation for command. That is, the "MS-DOS" in OS/2, Windows CE and Windows NT platform based operating systems (including Windows 2000 and XP, Vista, and Server 2003) Way. " The command prompt in the Chinese version of Windows XP further enhances compatibility with DOS operation commands, and users can enter the Chinese call file directly from the command prompt.
Today we will look at the various commands of the database, the following commands are all from the command line in 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 the reason that the environment variable is not set well, for example, my MYSQL installation directory is C:\NEWS\MYSQL, then in the environment variable in the system variable path to enter C:\news\mySql\MySQL Server 5.5\bin, restart CMD, Then enter MySQL, should be able to operate normally, of course, the premise is the MySQL service to start normally, if not start so cmd will show cannot CONNECT th ...
First, the MySQL statements are case-insensitive. Come to the first command:
The meaning of this sentence is to change the root password to 456, the original password is 123,-u to represent the user name, followed by the root username,-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 and the database IP address is 127.0.0.1, so you can write this:
1.2, MySQL Rights Management :
1.3. Add new users
First login to the MySQL database, root login after the selection of the database before the addition of new users to operate,
The following steps are run in conjunction with each other until the end of the semicolon, and the return key does not cause the command to end! To touch a semicolon, press ENTER to indicate the end statement.