MySQL学习笔记——显示数据库信息
2012-07-28 21:29
633 查看
show privileges
显示可用的系统权限清单。
View Code
select user,host from mysql.user;
显示服务器上用户账号的一个列表。
SET PASSWORD [for 'user'@'host']=PASSWORD('password')
修改用户账户密码。
SHOW GRANTS [FOR 'user'[@'host']]
为给定用户列出GRANT语句。如果没有指定FOR语句,默认为当前用户。
SELECT DATABASE();
显示当前数据库。
SELECT CURRENT_USER();
显示当前mysql服务器连接的用户名和主机的组合。
SELECT USER();
显示当前会话连接的用户名和主机的组合。
SHOW CREATE TABLE
[/code]
Shows the
[/code]
Shows the
待续。。。
显示可用的系统权限清单。
View Code
mysql> show privileges; +-------------------------+---------------------------------------+-------------------------------------------------------+ | Privilege | Context | Comment | +-------------------------+---------------------------------------+-------------------------------------------------------+ | Alter | Tables | To alter the table | | Alter routine | Functions,Procedures | To alter or drop stored functions/procedures | | Create | Databases,Tables,Indexes | To create new databases and tables | | Create routine | Databases | To use CREATE FUNCTION/PROCEDURE | | Create temporary tables | Databases | To use CREATE TEMPORARY TABLE | | Create view | Tables | To create new views | | Create user | Server Admin | To create new users | | Delete | Tables | To delete existing rows | | Drop | Databases,Tables | To drop databases, tables, and views | | Event | Server Admin | To create, alter, drop and execute events | | Execute | Functions,Procedures | To execute stored routines | | File | File access on server | To read and write files on the server | | Grant option | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess | | Index | Tables | To create or drop indexes | | Insert | Tables | To insert data into tables | | Lock tables | Databases | To use LOCK TABLES (together with SELECT privilege) | | Process | Server Admin | To view the plain text of currently executing queries | | Proxy | Server Admin | To make proxy user possible | | References | Databases,Tables | To have references on tables | | Reload | Server Admin | To reload or refresh tables, logs and privileges | | Replication client | Server Admin | To ask where the slave or master servers are | | Replication slave | Server Admin | To read binary log events from the master | | Select | Tables | To retrieve rows from table | | Show databases | Server Admin | To see all databases with SHOW DATABASES | | Show view | Tables | To see views with SHOW CREATE VIEW | | Shutdown | Server Admin | To shut down the server | | Super | Server Admin | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. | | Trigger | Tables | To use triggers | | Create tablespace | Server Admin | To create/alter/drop tablespaces | | Update | Tables | To update existing rows | | Usage | Server Admin | No privileges - allow connect only | +-------------------------+---------------------------------------+-------------------------------------------------------+
select user,host from mysql.user;
显示服务器上用户账号的一个列表。
SET PASSWORD [for 'user'@'host']=PASSWORD('password')
修改用户账户密码。
SHOW GRANTS [FOR 'user'[@'host']]
为给定用户列出GRANT语句。如果没有指定FOR语句,默认为当前用户。
SELECT DATABASE();
显示当前数据库。
SELECT CURRENT_USER();
显示当前mysql服务器连接的用户名和主机的组合。
SELECT USER();
显示当前会话连接的用户名和主机的组合。
SHOW CREATE TABLE
SHOW CREATE TABLE [code]tbl_name
[/code]
Shows the
CREATE TABLEstatement that creates the given table.
SHOW CREATE {DATABASE | SCHEMA} [code]db_name
[/code]
Shows the
CREATE DATABASEstatement that creates the given database.
SHOW CREATE SCHEMAis a synonym for
SHOW CREATE DATABASE.
待续。。。
相关文章推荐
- MySQL学习笔记——显示数据库信息
- C# 学习笔记(一) ListView控件显示数据库表信息
- MySQL服务器学习笔记!(二) ——数据库各项操作
- Mysql学习笔记——MySql导入导出数据库常用方法
- MySQL学习笔记(六):关于数据库中的datetime类型
- [入门]MySQL学习笔记一创建数据库和表
- Spring MVC 学习笔记10 —— 实现简单的用户管理(4.3)用户登录显示全局异常信息
- Mysql-学习笔记(==》数据库备份修复 十 四)
- mysql学习笔记1-sql分类和数据库操作
- Mysql与PostgreSql数据库学习笔记---打酱油的日子
- 数据库Mysql学习笔记(一)
- MySQL学习笔记之四 有关数据库操作
- android 学习笔记 数据库的创建, 查询 和删除表内的信息
- JAVA学习笔记_AMAP_拖拽选址及地理信息显示
- MySQL服务器学习笔记!(一) ——数据库相关概念
- Oracle 11g SQL开发指南 学习笔记之从数据库表中检索信息
- mysql 数据库学习笔记 3 外键 和 select 子查询
- MySQL存储过程和触发器的实现--数据库学习笔记
- Oracle Database :Oracle11g SQL开发指南学习笔记之(5):从数据库表中检索信息
- MemSQL学习笔记-类似MySQL的数据库