PHPstudy里mysql5.5升级到mysql5.7

我原先phpstudy的mysql版本是mysql5.5的,后边为了使用mysql5.7的新特性,就需要把phpstudy默认的MySQL升级到MySQL5.7
我下载的版本是:mysql-5.7.22-winx64.zip
1:把原来MySQL备份为MySQL_bak
2:把mysql-5.7.22-winx64.zip解压到D:\soft\phpstudy\PHPTutorial并改名为MySQL
3:从MySQL_bak里拷贝一个my.ini放到D:\soft\phpstudy\PHPTutorial\MySQL\bin目录里,高版本里my.ini需要放到bin目录里
我自己的测试my.ini内容如下:
   [client]
port=3306
[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir="D:/soft/phpstudy/PHPTutorial/MySQL/"
datadir="D:/soft/phpstudy/PHPTutorial/MySQL/data/"
character-set-server=utf8
default-storage-engine=INNODB
#支持 INNODB 引擎模式。修改为 default-storage-engine=INNODB 即可。
#如果 INNODB 模式如果不能启动,删除data目录下ib开头的日志文件重新启动。

max_connections=512

query_cache_size=0
tmp_table_size=32M

thread_cache_size=8
myisam_max_sort_file_size=64G
myisam_sort_buffer_size=35M
key_buffer_size=25M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K

innodb_additional_mem_pool_size=2M

innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M

innodb_buffer_pool_size=47M
innodb_log_file_size=24M
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
innodb_thread_concurrency=8
#新加
innodb_file_per_table = 1
skip-grant-tables = 1 #跳过权限验证
log-error = D:/soft/phpstudy/PHPTutorial/MySQL/data/error.log

4:然后已管理员身份运行cmd
   进入这个目录:D:/soft/phpstudy/PHPTutorial/MySQL/
   cd bin
   初始化mysql
   mysqld --initialize-insecure --user=mysql
   安装mysql5.7服务
   mysqld –install
   启动mysql
   net start mysql
   关闭mysql
   net stop mysql

5:登入mysql并修改密码
  mysql -u root -p
  直接回车,因为配置文件里配置了不进行登录验证
  进入mysql后执行:ALTER USER USER() IDENTIFIED BY 'root';修改root密码
6:至此,win10下phpstudy的mysql就升级完了

7:把配置文件里的skip-grant-tables = 1曲调再重启mysql
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值