SQL基本的操作命令

1. -- 单行注释; /*... */ 多行注释

2.连接数据库: 

mysql -u root -p

3. 修改用户密码:

update mysql.user set authentication_string=password('123456') where user='root' and Host= 'localhost';

4. 刷新权限:

flush privileges;

5. 查询所有数据库:

show databases;

6. 切换数据库:

use 数据库名称;

7. 查看数据库中的表:

show tables;

8.显示表的信息:

describe 表名称;

9. 新名一个数据库 :

create database 数据库名称;

 

posted @ 2022-01-07 17:32  欧阳雪1895  阅读(101)  评论(0)    收藏  举报