mysql8.0安装配置问题

window下安装:

1.到官网上下载mysql(zip包) 

》①mysql的bin目录下新建my.ini文件,配置参考如下:

mysql8.0安装配置问题

》②path中配置好环境变量

》③以管理员身份运行mysql服务

   mysql --install 安装服务,控制台会提示:Service successfully installed

   如果已安装,mysql --remove移除之前安装好的mysql 再次运行安装服务 

》④mysql --initialize生成data文件

》⑤启动服务 net start mysql

    停止服务 net stop mysql

》⑥开启无密码的mysql服务

      mysqld --console --skip-grant-tables --shared-memory

》⑦在新的dos窗口输入命令:mysql -uroot -p 密码直接回车

》⑧修改密码  select host,user,authentication_string=‘‘ where user=‘root‘;

》⑨重启服务,命令行mysql -uroot -p 直接回车进入mysql,修改密码即可

     mysql> alter user  root@localhost identified by ‘admin‘;

2.使用navicat客户端连接mysql8.0提示1251错误,解决方法参考如下:

mysql> alter user root@localhost identified by ‘admin‘ password expire never;
Query OK, 0 rows affected (0.01 sec)

mysql> alter user root@localhost identified with mysql_native_password by ‘admin‘;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql8.0安装配置问题

上一篇:Mysql索引数据结构为什么是B+树?


下一篇:【转】在命令行输入 mysql -u root -p 登录mysql,返回”Can't connect to MySQL server on localhost (10061)”错误