该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
1.配置环境变量 ;C:\mysql\mysql-5.7.18-winx64_server\bin
安装MySQL并修改密码
以管理员方式运行cmd
cd..
cd..
cd mysql
cd mysql-5.7.18-winx64_server
cd bin
mysqld --install //添加mysql服务
mysqld --initialize --console //初始化
net start mysql //启动服务
mysql -uroot -p //用户登录
鼠标右键标记 选择密码复制 Ctrl+v粘贴(回车键)
set password = password('123456'); //修改密码
grant all privileges on *.* to 'root'@'127.0.0.1' identified by '123456'; //修改密码后可以直接授权
2.授权
重新运行CMD
以管理员方式运行cmd
cd..
cd..
cd mysql
cd mysql-5.7.18-winx64_server
cd bin
mysql -uroot -p //用户登录
123456
grant all privileges on *.* to 'root'@'127.0.0.1' identified by '123456'; //修改密码后可以直接授权
3.重装mysql
以管理员方式运行cmd
cd..
cd..
cd mysql
cd mysql-5.7.18-winx64_server
cd bin
net stop mysql //停止服务
sc delete mysql 彻底删除mysql服务
mysqld --remove 删除mysql服务
删除C:\mysql\mysql-5.7.18-winx64_server目录下date文件夹
mysqld --install //添加mysql服务
mysqld --initialize --console //初始化
net start mysql //启动服务
mysql -uroot -p //用户登录
set password = password('123456'); //修改密码
重新运行CMD
以管理员方式运行cmd
cd..
cd..
cd mysql
cd mysql-5.7.18-winx64_server
cd bin
mysql -uroot -p //用户登录
123456
grant all privileges on *.* to 'root'@'127.0.0.1' identified by '123456'; //授权
mysqld --remove
mysql -nt -remove //删除
GRANT ALL PRIVILEGES ON dotproject.* TO dp_user’@‘localhost IDENTIFIED BY "12345678" WITH GRANT OPTION; 增加dp_user’@‘localhost用户