mysql study notes - database-related actions

MySQL login command:

mysql -uroot -p

MySQL exit command:

  exit    quit     \q     ctrl +C 

 

Common parameters:  

 - V     - Version // display version

 

Landing at the same time open the specified database:

MySQL - -uroot - the p- - D db_name // database name

Show all databases:

show databases;
show schemas

Create a database:

Create  Database  [ IF Not EXISTS ] DB - name [SET default Character '. 8-UTF']; // check the database and set the default encoding format if present

View details of the specified database:

show create database bd_name;

Modify the encoding specified database:

alter database db_name [dafault] character set  charset;

 

View a warning message appears on the step of:

show warnings;

Opens the specified database:

use db_name;

Get the currently open database:

select database();

Delete develop database:

drop database db_name;

 

Guess you like

Origin www.cnblogs.com/s1awwhy/p/11978042.html