下面提供几个可用的下载地址:
Mysql官网下载地址:https://downloads.mysql.com/archives/installer/
华为MySQL镜像站:https://mirrors.huaweicloud.com/mysql/Downloads/
PS C:\Users\Administrator> mysql -uroot -p
Enter password: *********
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
PS C:\Users\Administrator> mysqld --remove mysql
Service successfully removed.
PS C:\Users\Administrator> mysqld --initialize-insecure --user=mysql
PS C:\Users\Administrator> mysqld --install mysql
Service successfully installed.
PS C:\Users\Administrator> net start mysql
The mysql service is starting.
The mysql service was started successfully.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
skip-grant-tables
在命令行中输入 “mysql -uroot -p”(不输入密码),回车即可进入数据库。
执行,“use mysql;” 使用 mysql 数据库。
执行,[ update user set authentication_string=PASSWORD("rootroot") where user='root'; ] (修改 root 的密码)
update user set authentication_string=PASSWORD("rootroot") where user='root';
flush privileges;
打开 MySQL 目录下的 my.ini 文件,删除最后一行的 “skip-grant-tables”,保存并关闭文件。
重启 MySQL 服务
show global variables like 'port'; # 查看端口号:
mysql --version
mysqld --remove MySQL
net start mysql
net stop mysql
grant all privileges on *.* to 'webuser'@'%' identified by '123456' with grant option;
flush privileges;
####.mysql手动启动与停止,无服务的情况
D:\Program Files (x86)\mysql-5.7.35-winx64\bin
mysqld --defaults-file="D:\Program Files (x86)\mysql-5.7.35-winx64\my.ini"
pause
####停止mysql命令
mysqladmin -u root shutdown(在设置了密码的情况下的命令为mysqladmin -u root -p shutdown)