MYSQL database cmd command operation details, mysqlcmd
CMD command
Cmd is the abbreviation of command. that is, the command prompt (CMD) is based on OS/2, Windows CE and Windows NT platform (including Windows 2000 and XP, Vista, and Server 2003) under MS-DOS mode ". The command prompt in the Chinese version of Windows XP further improves compatibility with the operation commands in DOS. You can directly enter a chinese call file in the command prompt.
Today, let's take a look at the various database commands. the following commands are all input from the command line in the CMD command window. First, if you enter mysql, the system prompts "mysql is not an internal command or an external command. This is actually the reason why the environment variables are not set. For example, if the installation directory of my mysql is C: \ news \ mySql, enter C in the PATH of the system variable PATH in the environment variable: \ news \ mySql \ MySQL Server 5.5 \ bin, restart CMD, then enter mysql, it should be able to operate normally, of course, the premise is that the mysql service should start normally, if the command is not started, the command will display cannot connect th ..........
First, mysql statements are case-insensitive. Let's look at the first command:
mysqladmin -uroot -p123 password 456
In this statement, the root password is changed to 456. The original password is 123,-u indicates the user name, followed by the root user name, -p indicates that the second sign of the password is the logon password, and the space in the middle can be omitted. The space between password and new password cannot be omitted.
1.1 connect to a 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 IP address of the database is 127.0.0.1, you can write it as follows:
mysql -h 127.0.0.1 -u root -p 123
1.2 MySQL permission management:
1.3 add new users
First, log on to the mysql database. After the root user logs on, select the database before adding a new user,
> Use database_name; // select a database
The following steps are run together until the end ends with a semicolon. The enter key does not end the command! It is the end sentence that requires a semicolon and press Enter.
>grant all
Articles you may be interested in:
- Mysql cmd Common commands
- How to Use cmd to connect to a Mysql database
- Detailed description of how cmd connects to mysql
- Troubleshooting of MySQL Chinese data garbled in cmd
- How to quickly access mysql using cmd