建立数据库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

原文地址:https://www.cnblogs.com/cjzzx/p/6928891.html