mysql安装使用--2 用户管理

1 修改mysql.user表

添加用户

mysql> INSERT INTO mysql.user (Host,User,Password) VALUES (\'%\',\'system\', PASSWORD(\'manager\'));
mysql> FLUSH PRIVILEGES

2 create 和  grant命令省略 


3 user表内容


MySQL用户名由两部分组成:(user, host),二者是联合主键。

describe mysql.user;

 Field                  | Type                              | Null | Key | Default | Extra |
+------------------------+-----------------------------------+------+-----+---------+-------+
| Host                   | char(60)                          | NO   | PRI |         |       | 
| User                   | char(16)                          | NO   | PRI |         | 

%表示对应user可以从任意地址登录,localhost表示只能本地登录


select * from user limit 10;
+--------------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+--------+-----------------------+
| Host         | User    | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string |
+--------------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+--------+-----------------------+
| localhost    | root    | *949B9BA5F728DDB5C35A6BF29CF896B9A1F5E7E3 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 |        |                       | 
| %            | **** | *2F2DBDE71A51D19B22DB0D5665E8F4F4DFDA8C6A | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 |        |                       | 
| 192.168.3.11 | root    | *949B9BA5F728DDB5C35A6BF29CF896B9A1F5E7E3 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 |        |                       | 
| ::1          | root    | *949B9BA5F728DDB5C35A6BF29CF896B9A1F5E7E3 | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 |        |                       | 
| 192.168.3.13 | repl    | *FD571203974BA9AFE270FE62151AE967ECA5E0AA | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | Y               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 |        | NULL                  | 
| %            | read | *DEE0C5DA1B54F7D4BA0B60BDE7B6D50BBFA3B8AF | Y           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 |        | NULL                  | 
+--------------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+--------+-----------------------+
6 rows in set (0.00 sec)





转载于:https://www.cnblogs.com/catkins/p/5270469.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/407975.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

constexpr if --- C++ 20

constexpr if — C 20 constexpr if 可以让我们实现条件编译 template <typename T> auto getResult(T t) {if constexpr (std::is_integral_v<T>)return *t;elsereturn t; }如果T是intergral类型,执行第一个分支,否则执行第二个分支 还记得前文写过的模板元编程…

WPF中的动画

WPF中的动画 周银辉动画无疑是WPF中最吸引人的特色之一&#xff0c;其可以像Flash一样平滑地播放并与程序逻辑进行很好的交互。这里我们讨论一下故事板。在WPF中我们采用Storyboard&#xf…

c/c++面试试题(四)

華為1、局部变量能否和全局变量重名&#xff1f;答&#xff1a;能&#xff0c;局部会屏蔽全局。要用全局变量&#xff0c;需要使用"::"局部变量可以与全局变量同名&#xff0c;在函数内引用这个变量时&#xff0c;会用到同名的局部变量&#xff0c;而不会用到全局变量…

[访问系统] Api_Win32_Mac类工具包 (转载)

点击下载 Api_Win32_Mac.zip using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices;namespace BaseFunction {class API{[DllImport("kernel32")]//内存public static extern void GlobalM…

constexpr 函数

constexpr 函数 — C 20 constexpr double pi 3.14;constexpr允许你在编译时使用典型的C函数语法进行编程,但这并不意味之constexpr只和编译期有关 constexpr函数可以在编译期运行,也可以在运行时运行 但在以下情况constexpr函数必须在编译期运行: constexpr函数在编译的上…

react(82)--方法写在effects里面

effects: {*addOrUpdateAssistActivity({ payload, callback }, { call }) {try {const res yield call(addOrUpdateAssistActivity, payload);if (callback && typeof callback function) {yield callback(res);}} catch (error) {console.log(error);}},

让VS2005用起来更顺手

1. 在解决方案资源管理器中跟踪活动项VS2005 工具 选项 项目和解决方案 常规&#xff0c;把“在解决方案资源管理器中跟踪活动项”打勾。2. 显示行号VS2005 工具 选项 文本编辑器 C#&#xff0c;把“行号”打勾。或者 VS2005 工具 选项 文本编辑器 所有语言&…

C++面试题目(五)

思科1. 用宏定义写出swap&#xff08;x&#xff0c;y&#xff09;#define swap(x, y)/x x y;/y x - y;/x x - y;2.数组a[N]&#xff0c;存放了1至N-1个数&#xff0c;其中某个数重复一次。写一个函数&#xff0c;找出被重复的数字.时间复杂度必须为o&#xff08;N&#xff…

如何利用脚本方法清除文本框中汉字,从而保留英文字母和数字等

脚本方法如下&#xff1a; <script language"javascript" type"text/javascript"> function RemoveChineseCharacters(teleriktextboxID) {var textboxinput document.getElementById(teleriktextboxID);var textboxinputhidden document.g…

react(83)--filter

let newarr friendTableSource.filter(function(item, index, arr0) {return item.code ! val;});

constexpr和consteval --- C++ 20

constexpr和consteval — C 20 标准库容器和算法库对constexpr 的应用 C20 中大量的算法和容器可以使用constexpr,这意味着你甚至可以再编译期vector<int>进行排序 Algorithms library - cppreference.com 如下: #include <iostream> #include <ranges>…

西藏攻略集锦

西藏旅游局针对初此进藏旅游的驴友提供实用资讯本文为西藏旅游局针对初次进藏的驴友提供实用资讯&#xff0c;供各位参考。 1、什么是高原反应&#xff1f;高原反应有哪些症状&#xff1f; 高原反应是人到达一定海拔高度后&#xff0c;身体为适应因海拔高度…

将select中的项从一个移动到另一个select中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns"http://www.w3.org/1999/xhtml" ><head> <title>将select中的项互相移动…

函数模板(参考《C++ Templates 英文版第二版》)

函数编程(参考《C Templates 英文版第二版》) Chapter 1 函数模板 1.1 一窥函数模板 template<class T> T max(T a, T b) {return b < a ? a : b; }#include "max1.hpp" #include <iostream> #include <string> #include <format>int…

Android FTP Server 1

下面介绍几种Android 版本的FTP Server : virtualdataline Virtual Data Line is a software that you can manage files of the phone on you pc without data line . Phone files can be copied to a computer and computer files can copied to the phone. With this …

Switcher ---Vista Areo 工具

推荐一个Vista Areo主题工具Switcher.可以从这里 [url]http://insentient.net/[/url] 获取 自由、创新、研究、探索…… 转载于:https://blog.51cto.com/shanyou/74271

很好的测试智商看看你能回答出来多少?一共75道!!

【1】假设有一个池塘&#xff0c;里面有无穷多的水。现有2个空水壶&#xff0c;容积分别为5升和6升。问题是如何只用这2个水壶从池塘里取得3升的水。 【2】周雯的妈妈是豫林水泥厂的化验员。 一天&#xff0c;周雯来到化验室做作业。做完后想出去玩。 "等等&#xff0c;妈…

react(84)--多张图片

<Form.Item label"上传封面图片"><BaseUploadImageonRef{(ref) > {this.upload ref;}}value{coverPaths}multiple/></Form.Item>

【ES实战】Elasticsearch6开始的CCR

【ES实战】学习使用Elasticsearch6开始的CCR 本文涉及官网文章地址 OverviewRequirements for leader indicesAutomatically following indicesGetting started with cross-cluster replicationUpgrading clusters CCR > Cross-cluster replication 文章目录 【ES实战】学…