mysql怎么查看用户名?


本文摘自PHP中文网,作者little bottle,侵删。

mysql查看用户名的方法:首先进入mysql并启动数据库;然后连接到数据库;最后输入“select host,user from mysql.user;”命令查看用户名以及信息即可。

我们在使用mysql的时候,有时候需要来查看当前用户。本篇文章将和大家讲述mysql怎么查看用户名,感兴趣的朋友可以了解一下。

启动数据库:

1

2

3

[root@server ~]# mysqld_safe &[1] 3289

[root@server ~]# 130913 08:19:58 mysqld_safe Logging to '/usr/local/mysql/data/server.gao.err'.

130913 08:19:58 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

连接到数据库:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

[root@server ~]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.13 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql>

阅读剩余部分

相关阅读 >>

mysql登录报错提示error 1045 (28000)错误的解决方法(图文)

sql语句在mysql中如何执行?

数据库添加索引

mysql笔记之运算符使用详解

mysql dml语句整理汇总

数据库完整性约束包括哪三种

pymysql模块的使用(增删改查)详解

mysql中关于事务的具体详解

mysql innodb索引原理的详细介绍(代码示例)

mysql怎么增加int字段?

更多相关阅读请进入《mysql》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...