关于MYSQL问题

来源:互联网 发布:变声软件女变男 编辑:程序博客网 时间:2024/05/16 11:54

监听端口:3306

 

新建数据库:

create database 数据库名;

 

打开数据库:

use  数据库名;

 

新建表:

create table 表名(

表项

);

 

添加数据:

insert into 数据库名 values("添加的数据项");

 

查询数据:

select *

from 表名;

 

查询数据库/表:

show databases/tables;

 

删除数据库/表:

drop database 数据库名/表名;

 

新建数据库用户:

grant user 用户名 identified by '密码';

 

新建数据库用户并授权:

grant user all  privileges to 数据库名.* on 用户名@'%' identified by '密码';

 

查询所有的用户:

select user password from mysql.user;

 

原创粉丝点击