建立数据库test1

一、建立数据库test1

建立数据库test1

建立数据库test1

建立数据库test1

 

建立数据库test1

二、数据库指令

--显示所有的数据库

show databases;

--切换使用数据库

use mysql;

--显示所有的表

show tables;

--查看表结构

desc user;

--查看数据库mysql的user表的信息

select Host,User,authentication_string form user;

--修改密码

  --错误示范,密码明文

update user set authentication_string='123' where user='root';

select '123456';

select password('123456');

  --加密密码字段

update user set authentication_string=password('123456') where user='root';

FLUSH PRIVILEGES;

--

--建立数据库

create database test1

--切换数据库

use test1;

--建表

create  table mytable(

  name varchar(200)

);

--登录数据库

mysql -uroot -p

 

相关文章:

  • 2021-05-22
  • 2021-11-16
  • 2022-12-23
  • 2021-07-29
  • 2022-02-08
  • 2021-12-02
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2021-11-30
  • 2021-12-31
  • 2021-06-28
  • 2021-07-01
  • 2021-12-14
相关资源
相似解决方案