mysql5.6和5.7的权限密码设置
mysql5.6
grant all privileges on *.* to root@'%' identified by "mysql_pwd" with grant option;
grant all privileges on *.* to root@'localhost' identified by "mysql_pwd" with grant option;
grant all privileges on *.* to root@'127.0.0.1' identified by "mysql_pwd" with grant option;
drop database if exists test;
use mysql;
delete from user where not (user='root');
delete from db where user='';
UPDATE user SET password=PASSWORD('mysql_pwd') WHERE user='root' AND host='127.0.0.1' OR host='%' OR host='localhost';
delete from user where password='';
flush privileges;
select user,password,host from mysql.user;
exit;
mysql5.7:
grant all privileges on *.* to root@'%' identified by "mysql_pwd" with grant option;
grant all privileges on *.* to root@'localhost' identified by "mysql_pwd" with grant option;
grant all privileges on *.* to root@'127.0.0.1' identified by "mysql_pwd" with grant option;
drop database if exists test;
use mysql;
delete from user where not (user='root');
delete from db where user='';
delete from user where authentication_string='';
update mysql.user set authentication_string=password('mysql_pwd') where user='root' AND host='127.0.0.1' OR host='%' OR host='localhost';
flush privileges;
select user,authentication_string,host from mysql.user;
exit;
mysql5.6和5.7的权限密码设置的更多相关文章
- (转)mysql账号权限密码设置方法
原文:http://www.greensoftcode.net/techntxt/2013410134247568042483 mysql账号权限密码设置方法 我的mysql安装在c:\mysql 一 ...
- redis密码设置、访问权限控制等安全设置
redis作为一个高速数据库,在互联网上,必须有对应的安全机制来进行保护,方法有2,如下. 1.比较安全的办法是采用绑定IP的方式来进行控制. 请在redis.conf文件找到如下配置 # If y ...
- Mysql用户密码设置修改和权限分配
我的mysql安装在c:\mysql 一.更改密码 第一种方式: 1.更改之前root没有密码的情况 c:\mysql\bin>mysqladmin -u root password " ...
- 修改本地数据库root权限密码
方法1: 用SET PASSWORD命令 测试成功 首先登录MySQL @1——mysql DOS 窗口中. 格式:mysql> set password for 用户名@localhost = ...
- Centos7.3下mysql5.7.18安装并修改初始密码的方法
Centos7.3下mysql5.7.18安装并修改初始密码的方法 原文链接:http://www.jb51.net/article/116032.htm 作者:Javen205 字体:[增加 减小] ...
- ubuntn中root密码设置和权限给予
个人理解: 1.安装ubuntn,会首先要求有一个账号密码设置,比如我设置的:用户名irt,密码**,这是一个普通账户,此时,超级管理账户root密码是空的: 2.给root账户设置密码,大概步骤见下 ...
- mysql5.7密码设置
mysql5.7版本引入了强制更改密码的举措,只能吐槽一句,shit!mysql5.7安装安装完mysql之后,mysql已经随机指定了一个初始化密码,可以在mysql的错误日志中找到初始化密码: c ...
- day 7-11 初识MySQL数据库及安装密码设置破解
一. 什么是数据库 之前所学,数据要永久保存,比如用户注册的用户信息,都是保存于文件中,而文件只能存在于某一台机器上. 如果我们不考虑从文件中读取数据的效率问题,并且假设我们的程序所有的组件都运行在一 ...
- {MySQL数据库初识}一 数据库概述 二 MySQL介绍 三 MySQL的下载安装、简单应用及目录介绍 四 root用户密码设置及忘记密码的解决方案 五 修改字符集编码 六 初识sql语句
MySQL数据库初识 MySQL数据库 本节目录 一 数据库概述 二 MySQL介绍 三 MySQL的下载安装.简单应用及目录介绍 四 root用户密码设置及忘记密码的解决方案 五 修改字符集编码 六 ...
随机推荐
- Lua与C++交互初探之C++调用Lua
Lua与C++交互初探之C++调用Lua 自从学习了lua这个脚本语言之后,无时不想着将他与c/c++联系起来,看看他真正的威力.奈何水平有限,网上找的代码无论怎样都无法运行成功.我知道是我少了某一步 ...
- 分享一套好看的PyCharm Color Shceme 配色方案
配色方案图1 点击可查看大图 (color shceme 配色文件下载链接已经放在文末) 配色方案图2 配色方案图3 picture1 picture2 整体效果 下载链接 https://files ...
- 添加并启动MySQL服务
1. 右键开始菜单,选择 2. 进入到MySQL安装目录下的bin目录,输入命令: mysqld.exe -install 3.启动mysql服务,输入命令: net start mysql
- input标签添加上disable属性在移动端(ios)字体颜色及边框颜色不兼容的解决办法。
手机一些兼容性问题: 1.苹果手机输入框input:disabled显示模糊问题 input:disabled, input[disabled]{ color: #5c5c5c; -webkit-te ...
- 吴裕雄--天生自然 JAVA开发学习:异常处理
try { // 程序代码 }catch(ExceptionName e1) { //Catch 块 } import java.io.*; public class ExcepTest{ publi ...
- 获取cell上按钮事件
原由:点击cell上的按钮,无法获取button对应的cell位置 //获取按钮上层控件,也就是cell本身 AccountCell *cell= (AccountCell *)[按钮名称 super ...
- Linux保护机制
RELRO(RELocation Read Only) 在Linux中有两种RELRO模式:"Partial RELRO" 和 "Full RELRO".Lin ...
- [LC] 151. Reverse Words in a String
Given an input string, reverse the string word by word. Example 1: Input: "the sky is blue" ...
- [LC] 270. Closest Binary Search Tree Value
Given a non-empty binary search tree and a target value, find the value in the BST that is closest t ...
- 用 Apache Derby 进行 ODBC 编程
用 Apache Derby 进行 ODBC 编程 https://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0409kar ...