资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

mysql怎么刷新权限 mysql刷新权限flush

MySQL重新安装后如何重新载入权限

没有密码为MYSQL加密码:

成都创新互联公司专业为企业提供长顺网站建设、长顺做网站、长顺网站设计、长顺网站制作等企业网站建设、网页设计与制作、长顺企业网站模板建站服务,十年长顺做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

mysql -uroot -p

回车

提示输入密码,为空回车

刷新权限表,输入如下命令

flush privileges;

退出

quit

mysql局域网访问权限怎么设置

第一:更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称'%'。

或者新加条记录,“host” 项为要访问的ip地址,并授权。重启mysql服务。

第二:在系统防火墙添加例外端口:3306,并允许例外。错误提示:

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 -pvmwaremysqluse mysql;mysqlupdate user set host = '%' where user = 'root';mysqlselect host, user from user; 2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

3.在window自带的防火墙里的例外添加3306端口

总结:mysql -u root -p

mysqluse mysql;

mysqlselect 'host' from user where user='root';

mysqlupdate user set host = '%' where user ='root';

mysqlflush privileges;

mysqlselect 'host' from user where user='root';

第一句是以权限用户root登录

第二句:选择mysql库

第三句:查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)

第四句:修改host值(以通配符%的内容增加主机/IP地址),当然也可以直接增加IP地址

第五句:刷新MySQL的系统权限相关表

第六句:再重新查看user表时,有修改。。

重起mysql服务即可完成。

如何设置mysql用户的权限

1、创建新用户

通过root用户登录之后创建

grant all privileges on *.* to testuser@localhost identified by "123456" ;//创建新用户,用户名为testuser,密码为123456 ;

grant all privileges on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,可以在本地访问mysql

grant all privileges on *.* to testuser@"%" identified by "123456" ; //设置用户testuser,可以在远程访问mysql

flush privileges ;//mysql 新设置用户或更改密码后需用flush privileges刷新MySQL的系统权限相关表,否则会出现拒绝访问,还有一种方法,就是重新启动mysql服务器,来使新设置生效

2、设置用户访问数据库权限

grant all privileges on test_db.* to testuser@localhost identified by "123456" ;//设置用户testuser,只能访问数据库test_db,其他数据库均不能访问 ;

grant all privileges on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,可以访问mysql上的所有数据库 ;

grant all privileges on test_db.user_infor to testuser@localhost identified by "123456" ;//设置用户testuser,只能访问数据库test_db的表user_infor,数据库中的其他表均不能访问 ;

3、设置用户操作权限

grant all privileges on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;//设置用户testuser,拥有所有的操作权限,也就是管理员 ;

grant select on *.* to testuser@localhost identified by "123456" WITH GRANT OPTION ;//设置用户testuser,只拥有【查询】操作权限 ;

grant select,insert on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,只拥有【查询\插入】操作权限 ;

grant select,insert,update,delete on *.* to testuser@localhost identified by "123456" ;//设置用户testuser,只拥有【查询\插入】操作权限 ;

REVOKE select,insert ON what FROM testuser//取消用户testuser的【查询\插入】操作权限 ;

mysql中设置密码,怎么报错了?

这表示你密码错了,需要修改密码,而且要符合复杂性。

修改密码方式如下参考,

1、关闭 MySQL 服务器:

service mysql stop

2、进入目录,以安全模式启动 MySQL

cd /usr/local/mysql/bin

./mysqld_safe --skip-grant-tables

注意:

可能你的系统没有 safe_mysqld 程序(Windows 或 Ubuntu操作系统) ,可以使用 mysqld:

mysqld --skip-grant-tables

3、启动后, root 用户以空密码登录 mysql:

# mysql -u rootmysql update mysql.user set password=PASSWORD('123456') where User='root'; # 修改密码

mysql flush privileges; # 刷新权限

mysql quit

4、启动 MySQL:

service mysql start

这是就可以使用新密码 123456 登录了。

如果你知道密码,可以使用以下命令:

# mysqladmin -u root -p password 新密码

linux用命令怎么修改mysql用户的权限

mysql更改用户权限

This entry was posted by admin Monday, 26 April, 2010

1.“grant all on *.* to root@’%’ identified by ‘yourpassword’;”——这个还可以顺带设置密码。

2.“flush privileges; ”——刷新一下,让权限生效。

mysql的一些其他的管理,可以用mysqladmin命令。可以用来设置密码什么的。

grant方面的详细信息可以看我下面的转载:

本文实例,运行于 MySQL 5.0 及以上版本。

MySQL 赋予用户权限命令的简单格式可概括为:

grant 权限 on 数据库对象 to 用户

一、grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。

grant select on testdb.* to common_user@’%’

grant insert on testdb.* to common_user@’%’

grant update on testdb.* to common_user@’%’

grant delete on testdb.* to common_user@’%’

或者,用一条 MySQL 命令来替代:

grant select, insert, update, delete on testdb.* to common_user@’%’


分享文章:mysql怎么刷新权限 mysql刷新权限flush
网页网址:http://cdkjz.cn/article/hggjco.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220