安装
mysql-8.0.19-winx64.zip 直接解压即可
配置
环境变量配置
# 1)新建环境变量
MYSQL_HOME = 'path/to/mysql'
# 2)path中追加 (也可直接 path 中添加 /path/to/mysql/bin)
path %MYSQL_HOME%\bin
# 3)打开命令行工具cd到安装目录
# 4)输入命令
mysqld -install # 安装mysql服务
mysqld -initialize # 初始化mysql
# 5)打开data目录下拓展名为.err的文件找默认密码password
# 6)cmd输入命令
net start mysql
mysql -uroot -p 默认密码
# 7)密码修改
> alter user 'root'@'localhost' identified by 'password';
> flush privileges;
> quit;
远程权限
# 查看权限
SELECT user,host, from mysql.user;
# 修改密码
alter user 'root'@'localhost' identified by 'yourpassword';
# 创建用户 (@代表所有主机、ip)
create user 'username'@'%' identified by 'password';
# 用户授权 (*.* => 库.表)
grant all privileges on *.* to 'username'@'%';
# 远程登录授权
alter user 'username'@'%' identified with mysql_native_password by 'password';
写在最后
欢迎留言私信讨论;
文章有知识性错误请立马联系博主,博主将非常感谢;
无需经过允许即可随意使用转载,知识本来就是被广泛用来学习的。
非常感谢您能看到此处,本文为博主学习笔记,如有不同见解,请不吝赐教;