mysql权限修改记录
select user, password, host from mysql.user;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'147.114.169.197' IDENTIFIED BY '1' WITH GRANT OPTION;
update mysql.user set password='' where host='147.114.169.197';
flush privileges;
ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';
查看数据表的大小:
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES;
查看数据库物理文件位置:
show global variables like '%datadir%';
select user, password, host from mysql.user;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'47.104.1.31' IDENTIFIED BY '1' WITH GRANT OPTION;
update mysql.user set password='' where host='47.104.1.31';
flush privileges;
win10下安装 mysql 5.7
地址
https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.16-winx64.zip
win10下启动 mysql 5.7 1、解压 mysql-5.7.16-winx64.zip , D:\soft\mysql\mysql-5.7.16-winx64
2、在bin目录下创建 my.ini , 内容为 [mysqld] basedir=D:\soft\mysql\mysql-5.7.16-winx64 datadir=D:\soft\mysql\mysql-5.7.16-winx64\data 3、初始化 mysqld mysqld --initialize --user=mysql --console 不带随机密码的 mysqld --initialize-insecure --user=mysql --console 4、启动 mysqld 5、访问 mysql -h127.0.0.1 -uroot -e "show databases;"
6、设置任意ip以密码123456访问 mysql -uroot -e "use mysql; select host, user from user where user='root' ;" GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; mysql -h127.0.0.1 -uroot GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.31.140.155' IDENTIFIED BY '123456' WITH GRANT OPTION; update user set host='%' where host='172.31.140.155'; flush privileges;