MySQL Database Command Line Client

Source: Internet
Author: User

1 1. Enter Password: ******2 2. ues MySQL; using MySQL3 3. show databases; show Database4 4. Use register, using the database name register5 5. Show tables; show tables in the Register database6 6. Describe user, operation on table User:7 8Insert into User (Username,password) VALUES ("XiaoYan","123456"); Insert Data9Insert into User (Username,password) VALUES ("FF","123456"); Insert DataTenDelete fromUserwhereUsername="XiaoYan"; Delete Data OneUpdate userSetUsername="XiaoYan" whereUsername="FF"; Update Data A Select* fromuser; query data -  - 7. Quit; launch the 1, displays a list of databases in the current database server: -Mysql>SHOW DATABASES; - Note: MySQL library has the MySQL system information, we change the password and new users, is actually using this library to operate.  - 2, display the data tables in the database: +Mysql>Use library name; -Mysql>SHOW TABLES; + 3, display the structure of the data table: AMysql>DESCRIBE table name; at 4, Database creation: -Mysql>CREATE database name; - 5, set up the data table: -Mysql>Use library name; -mysql> CREATE Table table name (field name VARCHAR ( -), Field name CHAR (1)); - 6, delete the database: inMysql>DROP database name; - 7, delete data tables: toMysql>DROP table name; + 8, empty the records in the table: -Mysql>DELETE from table name; the 9, display the records in the table: *Mysql> SELECT *from table name; $ Ten, inserting records into the table:Panax NotoginsengMysql>INSERT into table name VALUES ("HyQ", "M"); -  One, update the data in the table: themysql-> UPDATE table name SET field name1= ' A', field name 2= ' B ' WHERE field name 3= ' C'; +  A, and load the data into the data table in text mode: Amysql> LOAD DATA LOCAL INFILE "d:/mysql.txt "into table table name; the  -, import. sql file command: +Mysql>Use database name; -Mysql> SOURCE d:/Mysql.sql; $  -, command line to modify the root password: $mysql> UPDATE mysql.user SET password=password (' New password ') WHERE user=' root '; -Mysql>FLUSH privileges; -  the, display the database name for use: theMysql>SELECT DATABASE (); -  -, display the current user:WuyiMysql>SELECT USER (); the  

Copy from:http://blog.csdn.net/jack2009win/article/details/6319261

MySQL Database Command Line Client

Related Article

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.