本文摘自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命令行修改mysql登录密码
mysql 百万级分页优化(mysql千万级快速分页)
mysql判断字段是否为null
mysql web端不能访问怎么办
深入理解mysql帮助命令(help)
mysql 8.0.17安装教程
mysql用什么代替in
mysql mac如何设置密码
mysql数据库如何修改表结构
简单讲解对wordpress数据库的认识及使用命令
更多相关阅读请进入《mysql》频道 >>
机械工业出版社
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。
转载请注明出处:木庄网络博客 » mysql怎么查看用户名?