Mysql5.6到5.7升级需要以下操作
/usr/local/mysql5.7/bin/mysql_upgrade -uroot -p123456 -h127.0.0.1 --force
mysql5.7怎么修改最大连接数
show variables like '%max_connections%';
/etc/my.cnf 添加:
max_connections=1000
重启
重启
grant all privileges on . to 'yangxin'@'%' identified by 'yangxin123456' with grant option;
all privileges:表示将所有权限授予给用户。也可指定具体的权限,如:SELECT、CREATE、DROP等。
on:表示这些权限对哪些数据库和表生效,格式:数据库名.表名,这里写“*”表示所有数据库,所有表。如果我要指定将权限应用到test库的user表中,可以这么写:test.user
to:将权限授予哪个用户。格式:”用户名”@”登录IP或域名”。%表示没有限制,在任何主机都可以登录。比如:”yangxin”@”192.168.0.%”,表示yangxin这个用户只能在192.168.0IP段登录
identified by:指定用户的登录密码
with grant option:表示允许用户将自己的权限授权给其它用户
flush privileges;
、用户重命名
rename user 'test3'@'%' to 'test1'@'%';
修改密码
mysql> use mysql;
mysql5.7之前
mysql> update user set password=password('123456') where user='root';
mysql5.7之后
mysql> update user set authentication_string=password('123456') where user='root';
mysql> flush privileges;
用set password命令
语法:set password for ‘用户名’@’登录地址’=password(‘密码’)
set password for 'root'@'localhost'=password('123456');
flush privileges;
@@@@@@@@@@@@@@@@@@@@@@@@@@@
忘记密码
vim /etc/my.cnf
[mysqld]
skip-grant-tables
mysql> update user set password=password("newpassword") where user='root';
mysql> flush privileges;