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'; 授权: ...
随机推荐
- input图片上传并显示查看判断图片类型
有一个问题:上传一次在上传一次关闭按钮会出现两次,关闭之后还有一个(改好了可以告诉我我在修正过来) <div id="box"> <div class=" ...
- [RxJS] Groupby operator
The use case is similar to Twitter "like" button, you can click "click" button o ...
- ClickHouse 分布式高可用集群搭建(转载)
一.ClickHouse安装方式: 源码编译安装 Docker安装 RPM包安装 为了方便使用,一般采用RPM包方式安装,其他两种方式这里不做说明. 二.下载安装包 官方没有提供rpm包,但是Alti ...
- Oracle Replace()函数与translate()函数 替换函数
简要比较: replace 字符串级别的代替 如:SELECT REPLACE('accd','cd','ef') from dual; --> aefd translate 字符级别的代替 如 ...
- ps -ef、ps aux(查看进程占用内存大小)
Linux下ps -ef和ps aux的区别及格式详解 Linux下显示系统进程的命令ps,最常用的有ps -ef 和ps aux.这两个到底有什么区别呢?两者没太大差别,讨论这个问题,要追溯到Uni ...
- python 使用 tibco ems
emshelper.py #encoding=utf-8 import jpype jvmpath=r"C:\Program Files\Java\jre1.8.0_161\bin\serv ...
- 花样流水灯的verilog实现
LED(Light emitting diode)发光二极管将电能转化为可见光,正向电压导通,反向电压截止.对于该板子,二极管用低电压导通,其实验原理图为: 所谓流水灯,即让LED像水一样的点亮,从左 ...
- A tow-day exam
D1 T1l \(des:\) 给出一棵树,判断树上两条路径是否相交 \(sol:\) 判断其中一条路径的两个端点以及两端点的 \(lca\) 是否存在于另一条链上 由于这是一棵树,任一点为根后这样判 ...
- Spring MVC原理及配置
Spring MVC原理及配置 1. Spring MVC概述 Spring MVC是Spring提供的一个强大而灵活的web框架.借助于注解,Spring MVC提供了几乎是POJO的开发模式,使得 ...
- StarUML自动生成Java代码
下载一个starUML 链接:https://pan.baidu.com/s/1pIGNVmhtwBxMrCG9LHdkCQ 提取码:c4i6 复制这段内容后打开百度网盘手机App,操作更方便哦 添加 ...