5.7.27版本mysql新增用户
因为我们目前只有root,所以只能先用root登陆mysql,再新增用户:
$ bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , 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> insert into mysql.user(Host,User,ssl_cipher,x509_issuer,x509_subject) values('localhost', 'wlf','','','');
Query OK, row affected (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec)
接着我们给新用户wlf设置密码:
mysql> set password for 'wlf'@'localhost' = password('wlf123');
Query OK, rows affected, warning (0.00 sec)
mysql> flush privileges;
Query OK, rows affected (0.00 sec)
然后我们新建数据库,并给wlf用户赋予权限,登陆口令跟wlf的密码一致:
mysql> create database nacos_config;
Query OK, row affected (0.00 sec) mysql> grant all privileges on nacos_config.* to wlf@localhost identified by 'wlf123';
Query OK, rows affected, warning (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec)
用wlf登陆后查看数据库,发现nacos_config已经建好了
[wlf@zjhz-cmread-test188 mysql]$ bin/mysql -u wlf -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| nacos_config |
+--------------------+
rows in set (0.00 sec)
5.7.27版本mysql新增用户的更多相关文章
- linux非root用户安装5.7.27版本mysql
先下安装包,到mysql官网https://dev.mysql.com/downloads/mysql/选好安装包版本.操作系统类型(默认是最新版本,点击右边链接Looking for previou ...
- 解决MySQL新增用户无法登陆问题
1. 新增用户 grant all on *.* to '库名'@'%' identified by '库名'; 2. 刷新授权表 flush privileges; 3. 删除空用户 use mys ...
- MySQL新增用户及赋予权限
创建用户 USE mysql; #创建用户需要操作 mysql 表 # 语法格式为 [@'host'] host 为 'localhost' 表示本地登录用户,host 为 IP地址或 IP 地址区间 ...
- mysql新增用户无法登陆问题解决ERROR 1045 (28000)
mysql增加新用户无法登陆解决方法 ERROR 1045 (28000): Access denied for user 'appadmin'@'localhost' (using password ...
- Mysql新增用户,权限管理
MySQL 赋予用户权限命令的简单格式可概括为:grant 权限 on 数据库对象 to 用户 一.grant 普通数据用户,查询.插入.更新.删除 数据库中所有表数据的权利. grant selec ...
- mysql新增用户
新开了个项目,数据库也想新搞个用户,先登陆mysql,看看原来都有哪些: root@wlf:/# mysql -uroot -p Enter password: Welcome to the MySQ ...
- MySQL新增用户以及数据库访问授权
# mysql -u root -p # 允许本地 IP 访问 localhost, 127.0.0.1 # insert into mysql.user(Host,User,Password) va ...
- mysql新增用户并开启远程连接
之前使用mysql一直使用root来连接登录数据库,现在想使用新的用户名来连接数据库,碰到数据连接不上的情况. 把这些记录下来,以备后用 1.首先,创建用户 CREATE USER 'xiazhenx ...
- mysql新增用户无法授权!? 解决方案
先上解决方法 :) 创建用户cat 密码 CREATE USER '; 修改user表中的注册用户cat update user set host='%' where user='cat'; 授权: ...
随机推荐
- python网络-静态Web服务器案例(29)
一.静态Web服务器案例代码static_web_server.py # coding:utf-8 # 导入socket模块 import socket # 导入正则表达式模块 import re # ...
- Python3中BeautifulSoup的使用方法
BeautifulSoup的使用 我们学习了正则表达式的相关用法,但是一旦正则写的有问题,可能得到的就不是我们想要的结果了,而且对于一个网页来说,都有一定的特殊的结构和层级关系,而且很多标签都有id或 ...
- SQL中 count(*)和count(1)的对比,区别
执行效果: 1. count(1) and count(*) 当表的数据量大些时,对表作分析之后,使用count(1)还要比使用count(*)用时多了! 从执行计划来看,count(1)和coun ...
- 《你们都是魔鬼吗》实验十二 团队作业八:Alpha冲刺
<你们都是魔鬼吗>第八次团队作业:Alpha冲刺 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 作业链接地址 团队名称 你们都是魔鬼吗 作业学习目标 软件测 ...
- 【测试工具】moco入门(一)
转自:https://www.cnblogs.com/tangqiu/p/9493147.html 简单来说,Moco就是解决了开发前端时没有后端支持,开发接口时依赖没有到位的尴尬场景.当然Moco的 ...
- JAVA BIO至NIO演进
主要阐述点: 1.同步/异步 or 阻塞/非阻塞 2.网络模型演进 3.NIO代码示例 一.同步/异步 or 阻塞/非阻塞 同步/异步:核心点在于是否等待结果返回.同步即调用者必须等到结果才返回, ...
- 学underscore在数组中查找指定元素
前言 在开发中,我们经常会遇到在数组中查找指定元素的需求,可能大家觉得这个需求过于简单,然而如何优雅的去实现一个 findIndex 和 findLastIndex.indexOf 和 lastInd ...
- js 全选反选
<th><input type="checkbox" id="checkall" name="checkall" oncl ...
- matlab的正则表达式
第一部分——单个字符的匹配1 句点符号 '.' ——匹配任意一个(只有一个)字符(包括空格).例如:t.n,它匹配tan. ten.tin和ton,还匹配t#n.tpn甚至t nMatlab例子程序: ...
- SPOJ - BALNUM - Balanced Numbers(数位DP)
链接: https://vjudge.net/problem/SPOJ-BALNUM 题意: Balanced numbers have been used by mathematicians for ...