MySQL Command 常见命令

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL Command 常见命令相关的知识,希望对你有一定的参考价值。

 

 

/* Load data from txt file */
LOAD DATA LOCAL INFILE "D:/data.txt" INTO TABLE tname;


/* Load .sql command file */
SOURCE D:/mysql.sql;


/* Change passowrd */
UPDATE mysql.user SET password = PASSWORD(123456) WHERE User = root;


/* Show current database */
SELECT DATABASE();


/* Show current user */
SELECT USER();


/* Create the database */
CREATE DATABASE dbname;


/* Choose the database */
USE dbname;


/* Delete the database */
DROP dbname;


/* Show the tables */
SHOW TABLES;


/* Describe the table */
DESCRIBE tname;


/* Create the table */
CREATE TABLE tname (id INT, name VARCHAR(30));


/* Delete the table */
DROP TABLE tname;


/* Delete the date in table */
TRUNCATE TABLE tname;


/* Insert the table */
INSERT INTO tname VALUES (1, hello);


/* Search the table */
SELECT id, name FROM tname WHERE id = 1 ORDER BY DESC;


/* Update the table */
UPDATE tname SET name = world WHERE id = 1;


/* Display the table */
SELECT * FROM tname;

 

More Information Check:

http://blog.csdn.net/ithomer/article/details/5131863

 

以上是关于MySQL Command 常见命令的主要内容,如果未能解决你的问题,请参考以下文章

mvn命令异常:An error has occurred in Javadoc report generation: Unable to find javadoc command异常已解决(代码片段

mvn命令异常:An error has occurred in Javadoc report generation: Unable to find javadoc command异常已解决(代码片段

VSCode自定义代码片段——cli的终端命令大全

VSCode自定义代码片段4——cli的终端命令大全

VSCode自定义代码片段15——git命令操作一个完整流程

VSCode自定义代码片段15——git命令操作一个完整流程