Mysql入门

创建数据库

create database abc;

显示数据库

show databases;

使用数据库

use 数据库名;

直接打开数据库

mysql -h localhost -u root -p123456 -d 数据库名

显示表

show tables;

desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;
use information_schema
select * from columns where table_name='表名';

 

忘记密码处理

bin>net stop mysql

bin>mysqld --skip-grant-tables

bin>mysql

mysql>use mysql

mysql>update user set password=password("123456") where user="root";

mysql>flush privileges;

mysql>quit

bin>mysqladmin -u root -p shutdown

bin>net start mysql

 

posted @ 2020-03-26 18:18  绿茶GT  阅读(86)  评论(0)    收藏  举报