my.ini文件中搜索mysqld关键字,在下面添加skip-grant-tables ,我的my.ini配置如下:
port=3306
default-character-set=utf8
[mysqld]
skip-grant-tables
basedir=E:\MySQL\mysql-5.7.29-winx64
datadir=E:\MySQL\mysql-5.7.29-winx64\data
port=3306
character_set_server=utf8
default_storage_engine = InnoDB
max_connections=200
explicit_defaults_for_timestamp=true
win+R组合键打开命令行输入services.msc,进入服务重启MySQL服务
运行cmd,输入mysql -u root -p 就可以不用密码登录了,出现password:的时候直接回车可以进入
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘<id int,name varchar<15>>’ at line 1