text 基本MySQL命令(命令行/终端)

Posted

tags:

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

show databases; // Shows all databases
use db_name; //Moves into a database
show tables; // Shows all tablse of current database
create table tbl_name (id integer PRIMARY_KEY AUTO_INCREMENT, column1_name type NULL/NOT NULL, columnN_name type NULL/NOT NULL); //Creates a table with columns
describe todos; //Prints the table with details
insert into tblName (col1, colN) values ('valCol1', 'valColN'); // Inserts values into a table
select * from tblName; // Prints the selection from the database
select colName1, colNameN from tblName WHERE colName = 'value' //Prints the selection with a where clause

以上是关于text 基本MySQL命令(命令行/终端)的主要内容,如果未能解决你的问题,请参考以下文章