MySQL下查看用户和建立用户
启动数据库:
[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
连接到数据库:

[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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec) mysql>

查看用户状态:

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> select host,user from mysql.user;
+------------+------+
| host | user |
+------------+------+
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| localhost | root |
| server.gao | |
| server.gao | root |
+------------+------+
6 rows in set (0.00 sec) mysql>

创建用户:

mysql> create user 'usrabc'@'%' identified by 'usrabc';
Query OK, 0 rows affected (0.00 sec) mysql> select host,user from mysql.user;
+------------+--------+
| host | user |
+------------+--------+
| % | usrabc |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | |
| localhost | root |
| server.gao | |
| server.gao | root |
+------------+--------+
7 rows in set (0.00 sec) mysql> 删除
Delete FROM user Where User='test' and Host='localhost';
MySQL下查看用户和建立用户的更多相关文章
- CentOS下查看最后登录的用户信息以及LOG记录
CentOS下查看最后登录的用户信息tail /var/log/messagestail /var/log/secure 我们知道,在redhat下可以用lastlog查看各用户最后登录的信息,用la ...
- Linux下查看/管理当前登录用户及用户操作历史记录
转载自: http://www.cnblogs.com/gaojun/archive/2013/10/24/3385885.html 一.查看及管理当前登录用户 1.使用w命令查看登录用户正在使用的进 ...
- MySQL下创建数据库以及授权用户
一.新建数据库 1.首先登录MySQL:(输入 mysql -u root -p 命令,然后输入密码按回车即可) 2.在mysql> 下输入如下命令,回车,即可创建数据库 (test为数据库名) ...
- LINUX下查看php运行的用户
<?php echo shell_exec("id -a"); ?> 打开网页,显示 uid=2(daemon) gid=2(daemon) groups=2(daem ...
- Linux 下查看系统当前登录用户信息
当你新登录一个主机,过着管理一个主机,这时候你就需要这些命令来进行查看了: 1. w : Show who is logged on and what they are doing. w [optio ...
- linux下查看当前登陆的用户数目
在shell下输入以下语句即可获取: who | awk '{print $1}' | sort | uniq | wc -l
- linux下查看最后登陆的用户的信息
[root@oracle ~]# last -aroot pts/1 Wed Apr 1 10:35 still logged in 10.3.12.1输入命令last -a 把从何处登入系统的主机名 ...
- MySQL下查看和赋予权限
磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL杂记页 回到顶级页面:PostgreSQL索引页 [作者 高健@博客园 luckyjackgao@gmail. ...
- linux 下如何查看和踢除正在登陆的其它用户 ==>Linux下用于查看系统当前登录用户信息的4种方法
在linux系统中用pkill命令踢出在线登录用户 由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍 所以需要有时踢出指定的用户 1/#who 查出当前有那些终端登录(用 ...
随机推荐
- nyoj 79 导弹拦截
点击打开链接 拦截导弹 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 某国为了防御敌国的导弹袭击,发展中一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发 ...
- Loadrunner 添加windows资源没反应
使用 LoadRunner Controller 添加Windows资源系统没有反应, 解决办法 : 1.关闭Windows 防火墙 2.若使用的不是本机 1) 首先要启动所监测机器的remote r ...
- 网站图片优化-解码JPEG
首先,老大拿了两个网站工具的分析跟我说,让我分析一下我们网站的图片有没有什么方法优化. [网站分析工具]webpage test: http://www.webpagetest.org/谷歌pages ...
- Testing and Checking Refined
还是James大叔的文章:http://www.satisfice.com/blog/archives/856 本文提出了Testing和checking的定义和他们之间的区别. ========== ...
- 003.ASP.NET MVC集中管理Session
原文链接:http://www.codeproject.com/Tips/790387/Session-in-ASP-NET-MVC 1.前言 今天有得有失啊,看到这篇,专心记下里面的精华吧 2.一般 ...
- js获取服务器控件DropDownList所选中的各项属性
var ddl = document.getElementById("DropDownList1"); alert(ddl.selectedIndex);//选择索引值 alert ...
- oracle 索引失效原因
转自 http://www.cnblogs.com/orientsun/archive/2012/07/05/2577351.html Oracle 索引的目标是避免全表扫描,提高查询效率,但有些时 ...
- springMVC导出 CSV案例
导出csv 第一步 Controller类里调用 OrderParamsVo 传入的参数 orderService.findBuyCSV 查询到要导出的信息 /** * 购买订单CSV * Order ...
- js鼠标,键盘,坐标轴事件
鼠标按下事件,左键是0,滑轮是1,右键2 document.getElementById("box").onmousedown =function(e) { if (e.butto ...
- BZOJ1029 建筑抢修
Description 小刚在玩JSOI提供的一个称之为"建筑抢修"的电脑游戏:经过了一场激烈的战斗,T部落消灭了所有z部落的入侵者.但是T部落的基地里已经有N个建筑设施受到了严重 ...