Skip to content

Instantly share code, notes, and snippets.

@CoderInOne
Created May 8, 2019 08:33
Show Gist options
  • Save CoderInOne/e463e5fc934a7c99a190b87a9271af08 to your computer and use it in GitHub Desktop.
Save CoderInOne/e463e5fc934a7c99a190b87a9271af08 to your computer and use it in GitHub Desktop.
something@mysql/mariadb
  1. 安装

不要轻易听信任何一篇所谓安装教程。方法google mariadb install。 https://mariadb.com/kb/en/library/getting-installing-and-upgrading-mariadb/

  1. 创建用户

练习

# 给test_user在localhost上创建密码登录账户
create user test_user@localhost IDENTIFIED BY '123456';
  1. 授权

什么是授权?

https://mariadb.com/kb/en/library/grant/ 这里有权限的定义,本质是mysql.user重定义的各种权限,

# 给test_user访问、操作ezdis的所有权限
grant all privileges on ezdis.* to 'test_user'@'localhost';

# 查看能访问的数据库
select * from db where User = 'test_user';
  1. 本地登录验证

  2. 远程登录

访问路径,在aliyun那里卡住了,不知道阿里云那里要开放端口

(1) 确保tcp监听配置是对的,/etc/mysql/my.cnf,#bind-address = 127.0.0.1 (2) 注意创建的账户在哪个host上

local ----> networks ----> [aws/aliyun gateway]  ----> mysql                                     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment