mysql5.7.17安装+mysql error:1524+1045+外部访问出错

1.mysql5.7.17安装

windows10系统,下载mysql-5.7.17-winx64,copymysql-5.6.35-winx64的data文件,进入安装数据库目录bin:  cd C:\ProgramFiles\mysql-5.7.17-winx64\bin

安装服务:mysqld -install;

启动服务:net start mysql;

空密码进入:mysql -hlocalhost -uroot;

设置密码:

use mysql

update user set password=PASSWORD('123') where user='root';

2.赋予外网访问权限(否则外网访问显示没有权限)

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '123' WITH GRANT OPTION;

FLUSH PRIVILEGES;

3.解决错误ERROR 1524 (HY000)+1045

退出:quit;

重新登录:mysql -hlocalhost -uroot -p123

提示错误:

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1524 (HY000): Plugin '*23AE809DDACAF96AF0FD78ED04B6A265E05AA257' is not loaded

为避免密码显示不安全,改为:mysql -u root -p 123

提示输入密码:Enter password: ***

出错:ERROR 1524 (HY000): Plugin '*23AE809DDACAF96AF0FD78ED04B6A265E05AA257' is not loaded

设置使用空密码登录数据库  mysqld -uroot --skip-grant-table

登录数据库:mysql -uroot;

出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

用密码登录:mysql -uroot -p

重置plugin:  

 UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root';

FLUSH PRIVILEGES;

3.解决外部访问出错:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'performance_schema.session_variables' doesn't exist

进入bin目录,输入:

mysql_upgrade -u root -p --force

重启服务,ok





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值