grant

Centos 7 下安装mysql

为君一笑 提交于 2019-12-26 23:09:36
// 卸载原有 maridb-lib 库 [root@localhost ~]# rpm -qa | grep mariadb mariadb-libs-5.5.41-2.el7_0.x86_64 [root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64 CentOS 7 的 yum 源中貌似没有正常安装 mysql 时的 mysql-sever 文件 # yum -y install wget # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum -y install mysql-community-server 成功安装之后重启 mysql 服务 # service mysqld restart 初次安装 mysql 是 root 账户是没有密码的 设置密码的方法 # mysql -uroot // mysql> set password for ‘root’@‘localhost’ = password('mypasswd'); // 若不需要密码可以不执行此步骤 mysql> use

mysql 修改密码和授权

核能气质少年 提交于 2019-12-26 16:47:44
修改密码 格式: mysql > set password for 用户名 @HOST = password ( '新密码' ) 例子: mysql > set password for root @localhost = password ( '123456' ) 用户授权 必须以最高权力用户来授权 比如root等 grant all on stumysql . * to test @localhost identified by 'song123' ; grant select , insert , update , delete on * . * to test @"%" identified by 'song123' ; grant all on stumysql . * to test@ '192.168.0.0' identified by 'song123' 以上三条grant语句的授权参数详解: 1、授权 localhost主机通过test用户和song123密码访问本地的stumysql库的所有权限; 2、授权所有主机通过test用户和song123s密码访间本地的 stumysql库的查询、插入、更新、删除权限; 3、授权192.168.0.0主机通过test用户和song123密码访问本地的 stumysql库的所有权限。 来源: CSDN 作者:

mysql授权

对着背影说爱祢 提交于 2019-12-26 09:46:33
MySQL创建用户与授权 一. 创建用户 命令: CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明: username:你将创建的用户名 host:指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost,如果想让该用户可以从任意远程主机登陆,可以使用通配符% password:该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器 例子: CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456'; CREATE USER 'pig'@'192.168.1.101_' IDENDIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY ''; CREATE USER 'pig'@'%'; 二. 授权: 命令: GRANT privileges ON databasename.tablename TO 'username'@'host' 说明: privileges:用户的操作权限,如SELECT,INSERT,UPDATE等,如果要授予所的权限则使用ALL databasename:数据库名

服务器创建好后怎样使用远程连接工具链接的一些问题

大城市里の小女人 提交于 2019-12-26 05:25:04
报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost 报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。 例如,你想myuser使用mypassword从任何主机连接到mysql 服务器 的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 如果你想允许用户myuser从ip为192.168.1

MySQL: How to avoid a user from even seeing I have other DB's and grant select access to one view on one DB?

北战南征 提交于 2019-12-25 16:48:49
问题 I have several DB's in my server, and I need to allow one user to select records from a view in one of the DB's. But I need for this user to not even see that there are other DB's nor see that there are other tables in the DB where the view belongs. Is this possible? I had an account with a hosting company, a shared hosting account, and I could only see my DB when I accessed it through phpmyadmin. This is similar to what I need. Thank you for your help. 回答1: I've found the overview contained

How to convert MAIN mysql database to InnoDB from MyIsam

点点圈 提交于 2019-12-24 23:53:57
问题 I am trying to manage mysql group replication and I noticed a problem when manipulating users and grants . 10 of the main mysql tables in the main mysql database are MyIsam. So I cant add databases or user permissions because they fail and wont replicate. Master-master group replication requirs everything InnoDB. ALTER TABLE works fine on regular custom databases/tables but how do you fix this on the main mysql database? I tried this but they all fail: ALTER TABLE mysql.db ENGINE = InnoDB;

Execute stored proc fails with GRANT EXECUTE because of table permissions

混江龙づ霸主 提交于 2019-12-24 14:04:28
问题 I have created a stored proc on schema X that does a select across 10+ tables that are in schema X and Y. I created a database role DBRole and added a new AD Group Login to it. I thought all I needed to do was grant execute on x.MyStoredProc to DBRole, but I'm getting errors because of select permission.. Stored Procedure MYSCHEMA.MyStoredProc failed: The SELECT permission was denied on the object 'myTable', database 'Db', schema 'dbo'. I wondered if it was because the tables its failing on

grant to multiple db using one command

微笑、不失礼 提交于 2019-12-24 13:28:37
问题 I have many mariaDB databases that has same prefix. Such as apple1 apple2 apple3 .... apple5000 apple5001 banana1 banana2 ... banana100 And I want create new user USER who can SELECT databases has apple prefix. So I grant SELECT to new user USER using multiple command below to. GRANT SELECT ON `apple1` TO 'USER'@'%'; GRANT SELECT ON `apple2` TO 'USER'@'%'; GRANT SELECT ON `apple3` TO 'USER'@'%'; ... GRANT SELECT ON `apple5001` TO 'USER'@'%'; Is there any solution grant to multiple databases

mysql 远程连接权限

时光总嘲笑我的痴心妄想 提交于 2019-12-24 10:51:02
远程连接MYSQL提示Host is not allowed to connect to this MySQL server 2014年05月05日 17:51:03 阅读数:31892 如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server 1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

`Identified By Password` in Create Database MySQL

早过忘川 提交于 2019-12-24 09:29:13
问题 I reviewed the logs records for create database-user and it caught my attention: '*94060046C2F3321FA041154DF7FE002629402435' GRANT USAGE ON *.* TO 'username_name'@'localhost' IDENTIFIED BY PASSWORD '*94060046C2F3321FA041154DF7FE002629402435'; What is this password? 回答1: MySQL hashes passwords stored in the mysql.user table to obfuscate them. For most statements described here, MySQL automatically hashes the password specified. So '*94060046C2F3321FA041154DF7FE002629402435'; is the obfuscated