Mysql database in the operation of cmd command detailed _mysql

Source: Internet
Author: User

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.

 
 


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.