1、进入网站下载资源包:https://downloads.mysql.com/archives/community/
2、将下载好的压缩包,放到需要安装到的目录中解压,如下图所示。
3、以管理员身份打开cmd,进入mysql安装目录下的bin目录,然后输入指令:mysqld –initialize-insecure –user=mysql,创建data文件夹,运行及效果如下图所示。
该操作如果发生报错,mysqld: Could not create or access the registry key needed for the MySQL application
参考文章:
mysqld: Could not create or access the registry key needed for the MySQL applicationBUG解决
4、打开my.default.ini文件,输入红色箭头内容(以自己的文件路径为主)。
5、以管理员身份打开cmd,输入mysqld -install,安装mysqld
6、接着,尝试使用net start mysql 启动数据库mysql服务
7、最后,给自己的数据库设置一个初始密码,mysqladmin -u root -p password 123456
注意:这里的Enter password不要输入内容,直接Enter
8、尝试使用mysql -u root -p连接数据库服务器
9、验证是否成功,在进入数据库服务器后,输入status,若能显示如下信息则表示安装成功。