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 查出当前有那些终端登录(用 ...
随机推荐
- HappyNum
/*Write an algorithm to determine if a number is "happy". A happy number is a number defin ...
- Webservice测试从头来
一.写WebService 建立java project 建立数据类包 com.parameters.zz 新建Person类 package com.parameters.zz; public cl ...
- Spark Standalone模式伪分布式环境搭建
前提:安装好jdk1.7,hadoop 安装步骤: 1.安装scala 下载地址:http://www.scala-lang.org/download/ 配置环境变量: export SCALA_HO ...
- Skill
Skill Yasser is an Egyptian coach; he will be organizing a training camp in Jordan. At the end of ca ...
- Android开发-API指南-<provider>
<provider> 英文原文:http://developer.android.com/guide/topics/manifest/provider-element.html 采集(更新 ...
- Effective Modern C++翻译(1):序言
/*********************************************************** 关于书: 书是我从网上找到的effective Modern C++的样章,内 ...
- 集合函数COUNT
直接计算函数COUNT(*)的值,例如,计算pet表中猫的只数: 计算pet表中species的列的数目: 假如你想知道有多少不同种类的的宠物数目.你可以通过使用关键字DISTINCT来得到该数目: ...
- [JFinal 2] JFinal 开发框架
导读:在这次和大家一起开发的今日开讲后台管理系统中,我们用的是JFinal框架.开始的时候,说是用SSH,心里一阵窃喜,刚刚做了网上商城的项目,对于这个框架还算是接触过了.JFinal却是个新货,心里 ...
- Landsat 8 OLI_TIRS 卫星数字产品
产品描述 2013 年2月11日,美国航空航天局(NASA) 成功发射Landsat-8卫星.Landsat-8卫星上携带两个传感器,分别是OLI陆地成像仪(Operation ...
- 背景图片background-size兼容ie8以下浏览器解决
背景图片不够大,然后就想到用background-size:100%; 测试浏览器的时候发现ie8以下不兼容,图片会自动填充平铺过去,然后出现背景不好看的现象.解决方法: background-ima ...