mysql> 12 simple but staple commands教程

2019-12-28 17:03:13

Edit at: 2019-12-28 16:52:42

  • 1.mysql -u+username -p+password --> connect mysql
  • 2.use databasename --> select database
  • 3.show databases --> show all databases in your mysql server
  • 4.show tabels --> show all tables which are in selected database
  • 5.create database database\_name [charset charset\_name] -->create database
  • 6.drop database database\_name --> delete database which named database\_name
  • 7.create table table\_name(

var1 type,

var2 type) --> create table table\_name and its inside structure

  • 8.drop table table\_name --> delete table which called table\_name
  • 9.rename table old\_table\_name to new\_tabl\_name --> change your table's name
  • 10.insert into table\_name values (key1, value1), (key2, value2) -->insert dataline to a table
  • 11.truncate table\_name --> clear a table with a efficient way
  • 12.select * from table\_name --> show all datalines of table table\_name
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »