MYSQL Command Learning

Source: Internet
Author: User

MYSQL command:
Mysql-h host address-u user name-p password to connect to MYSQL; If MYSQL is just installed, the Super User root has no password.
(For example, mysql-h 110.110.110.110-Uroot-P123456)
Note: u and root do not need to add spaces. The same applies to others)
Exit to exit MYSQL
Mysqladmin-u username-p old password New password Change password
Grant select on database. * to username @ login host identified by \ "password \"; Add new users. (Note: Unlike the above, the following commands in the MYSQL environment are followed by a semicolon as the command Terminator)
Show databases; displays the Database List. At the beginning, there were only two databases: mysql and test. The mysql database contains the MYSQL system information. We change the password and add new users to use this database for operations.
Use mysql;
Show tables; displays data tables in the database
Describe table name; displays the table structure
Create database name; database creation
Use Database Name;
Create table Name (field setting list); create table
Drop database name;
Drop table name; delete database and table
Delete from table name; clear table records
Select * from table name; displays records in the table
Mysqldump -- opt school> school. bbb backup database: (the command is executed in the DOS \ mysql \ bin directory); Note: Back up the database school to school. bbb file, school. bbb is a text file with any file name. Open it and you will find a new one.
Add commands in win2003 System (practical part ):
Shutdown/the parameter disables or restarts the local or remote host.
Parameter description:/S disables the host,/R restarts the host,/T number sets the delay time, range 0 ~ Within 180 seconds,/A will cancel the boot and/M // the remote host specified by the IP address.
Example: shutdown/r/t 0 restart the local host immediately (no delay)
Taskill/the parameter process name or pid of the process to terminate one or more tasks and processes.
Parameter description:/PID indicates the pid of the process to be terminated. You can use the tasklist command to obtain the pid of each process, the name of the process to be terminated by the IM, And/F to forcibly terminate the process, /T terminate the specified process and its sub-processes.
Tasklist displays the process identifier (PID) of processes, services, and services currently running on local and remote hosts ).
Parameter description:/M lists the dll files loaded by the current process./SVC displays the services of each process. If no parameter is set, only the current process is listed.

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.