启动数据库:

[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下查看用户和建立用户的更多相关文章

  1. CentOS下查看最后登录的用户信息以及LOG记录

    CentOS下查看最后登录的用户信息tail /var/log/messagestail /var/log/secure 我们知道,在redhat下可以用lastlog查看各用户最后登录的信息,用la ...

  2. Linux下查看/管理当前登录用户及用户操作历史记录

    转载自: http://www.cnblogs.com/gaojun/archive/2013/10/24/3385885.html 一.查看及管理当前登录用户 1.使用w命令查看登录用户正在使用的进 ...

  3. MySQL下创建数据库以及授权用户

    一.新建数据库 1.首先登录MySQL:(输入 mysql -u root -p 命令,然后输入密码按回车即可) 2.在mysql> 下输入如下命令,回车,即可创建数据库 (test为数据库名) ...

  4. LINUX下查看php运行的用户

    <?php echo shell_exec("id -a"); ?> 打开网页,显示 uid=2(daemon) gid=2(daemon) groups=2(daem ...

  5. Linux 下查看系统当前登录用户信息

    当你新登录一个主机,过着管理一个主机,这时候你就需要这些命令来进行查看了: 1. w : Show who is logged on and what they are doing. w [optio ...

  6. linux下查看当前登陆的用户数目

    在shell下输入以下语句即可获取: who | awk '{print $1}' | sort | uniq | wc -l

  7. linux下查看最后登陆的用户的信息

    [root@oracle ~]# last -aroot pts/1 Wed Apr 1 10:35 still logged in 10.3.12.1输入命令last -a 把从何处登入系统的主机名 ...

  8. MySQL下查看和赋予权限

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页 [作者 高健@博客园  luckyjackgao@gmail. ...

  9. linux 下如何查看和踢除正在登陆的其它用户 ==>Linux下用于查看系统当前登录用户信息的4种方法

    在linux系统中用pkill命令踢出在线登录用户 由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍 所以需要有时踢出指定的用户 1/#who   查出当前有那些终端登录(用 ...

随机推荐

  1. NYOJ 52-无聊的小明

    点击打开链接 无聊的小明 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述       这天小明十分无聊,没有事做,但不甘于无聊的小明聪明的想到一个解决无聊的办法,因为他突 ...

  2. (medium)LeetCode 207.Course Schedule

    There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prer ...

  3. 剑指offer习题集

    1.重载赋值运算符函数:(具体见代码) //普通做法 CMyString& CMyString::operator=(const CMyString& str) { if (this ...

  4. 学习Webservice之入天气小试

    主要方法是:通过程序中设置代理用公司内网访问外部Webservice public InputStream getSoapInputStream(String url) { InputStream i ...

  5. ownDocument和documentElement

    <!DOCTYPE html> <html> <head> <meta name="viewport" content="wid ...

  6. UIView之基础控件综合事例

    九宫格算法实现及优化 2015年11月19日 星期四 23:21 1.九宫格之初实现 要求: 1.1在主界面中,点击添加按钮就能添加商品,点击删除按钮就能删除商品; 1.2在初始化界面中,添加按钮处于 ...

  7. 剑指Offer:面试题4——替换空格(java实现)

    问题描述:请实现一个函数,把字符串中的每个空格替换成"%20". 例如: 输入:"We are happy." 输出:"We%20are%20happ ...

  8. Android 中获取 debug 测试 SHA1 和 release SHA1 证书指纹数据的方法

    百度地图开发的时候要申请KEY,需要提供SHA1证书指纹数据 Eclipse eclipse中直接查看:windows -> preferance -> android -> bui ...

  9. 基于jQuery的web在线流程图设计器GooFlow

    简易的流程图设计控件,效果图: JavaScript源文件在GooFlow.js中,样式文件是GooFlow2.css.可以自定义样式. GooFlow_item类是每个项的样式属性. 但估计实现任务 ...

  10. oracle限制用户连接数

    查看是否启用限制配置 SQL> show parameter resource_limit; 或者 select * from v$parameterwhere name = 'resource ...