window:MySQL 5.7免安装版安装

1、配置环境变量

2、配置MySQL配置文件

my.conf ( Demo )

3、初始化

        以管理员身份运行cmd,进入bin目录

        输入:mysqld -install (如果不用管理员身份运行,将会因为权限不够而出现错误:Install/Remove of the Service Denied!)

        然后输入:mysqld --initialize-insecure --user=mysql (此操作会初始化data文件夹,如果不执行此操作,一般都会无法启动MySql服务)

4、更新密码

        放开 skip-grant-tables , 启动服务(net start mysql

        执行 mysql -u root -p , 还不输入密码直接进入

            update mysql.user set authentication_string=password('root') where user='root' ;

            commit;

注意:

        MySQL报错:The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

            解决办法:

                set global read_only=0;、(关掉新主库的只读属性)

                flush privileges;

        注释 skip-grant-tables,停止服务(net stop mysql),重启服务(net start mysql),使用密码正常登陆

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容