1. 把mysql5.7 解压到 电脑中!
打开cmd 进入到mysql bin文件中
无密码初始化 生成data
mysqld --initialize-insecure
mysql解压版默认没有my.ini文件 需要自己配置my.ini
[client] port=3306 default-character-set=utf8 [mysqld] # 设置为自己MYSQL的安装目录 basedir=E:mysql-5.7.22-winx64 # 设置为MYSQL的数据目录 datadir=E:mysql-5.7.22-winx64 port=3306 character_set_server=utf8
#character_set_server=utf8mb4 sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER #开启查询缓存 explicit_defaults_for_timestamp=true skip-grant-tables
安装
mysqld -install
设置密码
mysql -u root -p
use mysql
update user set authentication_string = password('root'), password_expired = 'N', password_last_changed = now() where user = 'root';
设置密码要刷新,否则不会生效
flush privileges;
设置远程访问
Grant all on *.* to 'root'@'%' identified by 'root' with grant option;
测试能否启动
net start mysql