欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql-5.7.23 zip版解压安装步骤

程序员文章站 2022-03-26 17:01:13
...
1、解压缩mysql-5.7.23-winx64.zip
2、新建.\mysql-5.7.23-winx64\my.ini
[mysqld]
port=3316
character-set-server=utf8
basedir ="C:\mysql-5.7.23-winx64\"
datadir ="C:\mysql-5.7.23-winx64\data\" 
max_allowed_packet = 32M

注意路径要用双引号包裹
3、执行以下命令:
mysqld install MySQL5.7 --defaults-file="C:\mysql-5.7.23-winx64\my.ini" 
mysqld  --initialize
mysqld --defaults-file="C:\mysql-5.7.23-winx64\my.ini" --console --skip-grant-tables
mysql -h127.0.0.1 -P 3316 -u root -p
use mysql;
update mysql.user set authentication_string=password('123456') where user='root'; 
update user set host = '%' where user = 'root';
flush privileges;
quit;
4、mysql密码过期的修改方法(your password has expired)
mysql -h127.0.0.1 -P 3316 -u root -p
set password = password('123456');
flush privileges;
quit;

MySQL8.0安装
mysqld  --initialize --console
mysqld --defaults-file="D:\mysql-8.0.17-winx64\my.ini" --shared-memory --console 
mysql -h127.0.0.1 -P 3306 -u root -p   
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; 
flush privileges;
quit;