记录Win10安装MySQL5.7的步骤
安装步骤
1、编写配置文件
[mysql] default-character-set=utf8 [mysqld] port=3306 basedir = D:\soft\mysql-5.7.22-winx64 datadir = D:\\soft\mysql-5.7.22-winx64\data max_connections=200 character-set-server=utf8 default-storage-engine=INNODB
2、在bin目录下打开CMD.exe执行一些命令,进行初始化。初始化完成后,会生成data目录
mysqld --initialize-insecure #初始化,生成root的账户 密码为空 mysqld --initialize #初始化,生成root账户,随机密码。在data目录-计算机名称.err日志里查找初始密码可能出现的问题,提示权限问题,要用管理员权限的CMD执行
目录路径问题, dir = D:soft 要改为 dir = D:\soft 可能“s”是特殊字符,需要转义。
3、执行一下命令 安装mysql服务
mysqld install执行后提示Service successfully installed.
4、执行net start mysql 启动mysql服务
net start mysql #启动MySQL服务
5、登陆MySQL
mysql -u root -p #空密码 登陆mysql
6、修改密码
#我使用的是笨方法 直接修改user表 mysql>use mysql; mysql> select user,authentication_string from user ; +---------------+-------------------------------------------+ | user | authentication_string | +---------------+-------------------------------------------+ | root | | | mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | | mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | +---------------+-------------------------------------------+ 3 rows in set (0.00 sec) mysql> update user set authentication_string =password('root') where user ='root'; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1
7、刷新权限
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
相关推荐
lpfvip00 2020-10-07
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11