mysql 添加远程访问
第一种:mysql 5.0(两种方式)
一、
在命令窗口输入,mysql -u root -p 回车,并输入密码
执行 use mysql
执行下面句子,查看权限,root默认权限为localhost
select user,host from user;
更改root权限为%
update user set host = '%' where user = 'root';
刷新
flush privileges;
二、
在命令窗口输入,mysql -u root -p 回车,并输入密码
执行 use mysql
设置test为账户,密码为:ceshipwd,权限为%,所有人
grant all on *.* to 'test'@'%' identified by 'ceshipwd';
如果权限不设置为所有人,可设定固定访问IP如下:
grant all on *.* to 'test'@'111.111.111.111' identified by 'ceshipwd';
最后,刷新
flush privileges;
第一种:mysql 8.0以上(两种方式)
一、
在命令窗口输入,mysql -u root -p 回车,并输入密码
执行 use mysql
执行下面句子,查看权限,root默认权限为localhost
select user,host from user;
更改root权限为%
update user set host = '%' where user = 'root';
刷新
flush privileges;
二、
在命令窗口输入,mysql -u root -p 回车,并输入密码
执行 use mysql
设置test为账户,密码为:ceshipwd,权限为%,所有人
先建立账号:
create user 'test'@'%' identified with mysql_native_password by 'ceshipwd';
再添加账号权限
grant all on *.* to 'test'@'%';
如果权限不设置为所有人,可设定固定访问IP如下:
grant all on *.* to 'test'@'111.111.111.111';
最后,刷新
flush privileges;
三、
各版本修改密码的格式:
mysql5.0格式如下:
本地可以访问
alter user 'ceshi'@'localhost' identified by 'ceshipw';
所有都可以访问
alter user 'ceshi'@'%' identified by 'ceshipw';
mysql8.0以上格式如下:
本地可以访问
alter user 'ceshi'@'localhost' identified with mysql_native_password by 'ceshipw';
所有都可以访问
alter user 'ceshi'@'%' identified with mysql_native_password by 'ceshipw';
*使用navicat连接mysql8.0数据库时,提示1251-client does not support authentication protocol requested by server;consider upgrading mysql client 解决办法:
进入数据库,更新一下认证格式
user mysql;
#下面方式是修改密码的格式,即可正常访问
alter user 'ceshi'@'%' identified with mysql_native_password by 'ceshipw';
flush privileges;
mysql 添加远程访问的更多相关文章
- mysql添加远程访问权限
GRANT 权限列表 ON 数据库.表 TO 用户账号 @ 用户ip IDENTIFIED BY 用户密码 授权命令; 权限列表:允许用户执行的操作权限. 包含select,insert,update ...
- windows版mysql添加远程访问
use mysql; ##然后查看下当前连接允许情况 select host, user, authentication_string, plugin from user; ##依次执行 CREATE ...
- HOSt ip is not allowed to connect to this MySql server, MYSQL添加远程用户或允许远程访问三种方法
HOSt ip is not allowed to connect to this MySql server 报错:1130-host ... is not allowed to connect to ...
- mysql添加一个用户
对于添加mysql的远程访问用户,一定要记得刷新刷新系统权限表不然你怎么弄都是不成功的. insert into mysql.user(Host,User,Password) values(" ...
- mysql添加federated引擎实现dblink远程表访问
查看mysql数据库federated引擎是否开启. show engines; 若没有开启federated则在mysql配置文件my.cnf中mysqld中添加federated. 在远程数据库中 ...
- mysql添加,授权,删除用户以及连接数据库Can't connect to MySQL server on '192.168.31.106' (113)错误排查
centos7下面操作mysql添加,授权,删除用户 添加用户 以root用户登录数据库,运行以下命令: create user test identified by '; 上面创建了用户test,密 ...
- 在Linux中安装MariaDB并添加远程访问
在Linux中安装MariaDB并添加远程访问 最近学习到了数据库部分,因为有一台台式机一台笔记本换着用,就没有把数据库安装在本机,本来打算用之前买的虚拟空间的数据库的,结果速度太慢用起来太难受了,就 ...
- linux下mysql开启远程访问权限及防火墙开放3306端口
默认mysql的用户是没有远程访问的权限的,因此当程序跟数据库不在同一台服务器上时,我们需要开启mysql的远程访问权限. 主流的有两种方法,改表法和授权法. 相对而言,改表法比较容易一点,个人也是比 ...
- ubuntu下mysql添加用户的问题
在ubuntu下使用命令: $:sudo apt-get install mysql-server 命令安装的Mysql 版本为:Server version: 5.7.13-0ubuntu0.16. ...
随机推荐
- RabbitMQ 的使用
MiaoshaMessage 类 ---------------------------------------------------------------- import com.imooc. ...
- C#实现http协议GET、POST请求
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Ne ...
- spring学习日志二
一.spring依赖注入的方式 1.通过set方法来完成注入 <bean id="student" class="com.zhiyou100.xz.spring.S ...
- 刷题-力扣-230. 二叉搜索树中第K小的元素
230. 二叉搜索树中第K小的元素 题目链接 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/kth-smallest-element-in-a ...
- Spark Ignite踩坑记录
Ignite spark 踩坑记录 简述 ignite访问数据有两种模式: Thin Jdbc模式: Jdbc 模式和Ignite client模式: shell客户端输出问题,不能输出全列: 针对上 ...
- Redis(三):新数据类型
配置文件redis.conf详解 bind=127.0.0.1 # 表示只能在本机中访问redis,将该行注释掉,即可接收任何IP地址的访问 protected-mode # 设置为no,表示关闭保护 ...
- jmeter实际场景应用之测试上传excel文件
日常工作上测试的时候,会有一些场景是导入/上传文件.我们系统多是excel文件,这里就用excel文件为例,详述一下此次测试遇到的坑.最终结果是成功的,请看到最后! 1.获取接口的一些参数信息 先按F ...
- 登录用户出现‘’-bash-4.2$‘’的问题解决
Linux系统切换用户时如显示的是-bash-4.2# 而不是user@主机名 + 路径的显示方式,以往一直用的脚本也不能执行起来: 原因是在用useradd添加普通用户时,有时会丢失家目录下的环境变 ...
- constexpr-C++11
constexpr和常量表达式 常量表达式(const expression)是指值不会改变并且在编译过程就能得到计算结果的表达式.显然,字面值属于常量表达式,用常量表达式初始化的const对象也是常 ...
- IDEA中mybatis generator使用
1.在对应服务的pom.xml文件中添加依赖 <build> <plugins> <plugin> <groupId>org.mybatis.gener ...