升级phpstudy2018默认mysql版本到5.7
phpstudy2018默认自带MySQL版本是5.5,现将其升级到5.7
1.备份原来的MySQL文件夹phpstudyPHPTutorialMySQL重命名为MySQL5.5
2.将下载的mysql5.7压缩文件解压缩,并放在phpstudyPHPTutorial文件夹下,命名为MySQL;
3.将备份的MySQL5.5中的my.ini文件拷贝到phpstudyPHPTutorialMySQLin目录下
my.ini的参考内容:
[client]port=3306[mysql]default-character-set=utf8 [mysqld]port=3306 dir="D:/phpstudy/PHPTutorial/MySQL/"datadir="D:/phpstudy/PHPTutorial/MySQL/data/"character-set-server=utf8default-storage-engine=INNODB#支持 INNODB 引擎模式。修改为 default-storage-engine=INNODB 即可。#如果 INNODB 模式如果不能启动,删除data目录下ib开头的日志文件重新启动。 max_connections=512 query_cache_size=0tmp_table_size=32M thread_cache_size=8myisam_max_sort_file_size=64Gmyisam_sort_buffer_size=35Mkey_buffer_size=25Mread_buffer_size=64Kread_rnd_buffer_size=256Ksort_buffer_size=256K innodb_additional_mem_pool_size=2M innodb_flush_log_at_trx_commit=1innodb_log_buffer_size=1M innodb_buffer_pool_size=47Minnodb_log_file_size=24Minnodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8innodb_thread_concurrency=8#新加innodb_file_per_table = 1skip-grant-tables = 1 #跳过权限验证log-error = D:/phpstudy/PHPTutorial/MySQL/data/error.log4.以管理员身份运行cmd
进入phpstudyPHPTutorialMySQLin目录;
运行mysqld --initialize初始化MySQL;
运行mysqld –install安装MySQL;
5.修改密码:
登入mysql:mysql -u root -p
(因为配置文件里配置了不进行登录验证)
进入mysql后执行:ALTER USER USER('你的密码') IDENTIFIED BY 'root';
进行root密码修改,修改完成设置配置文件里的skip-grant-tables = 1,再重启mysql
6.apache或nignx能启动mysql启动不了
之前已经装过Mysql,要把系统服务里面的MySQL删除,留下MySQLa服务。
在cmd命令行下输入:sc delete mysql 即可删除。
参考美文:
https://blog.csdn.net/u010300913/article/details/79193328
继续阅读与本文标签相同的文章
下一篇 :
excel导入工具
-
使用paho的MQTT时遇到的重连导致订阅无法收到问题和解决
2026-05-25栏目: 教程
-
基于struts2的记住账号密码的登录设计
2026-05-25栏目: 教程
-
用娃娃机打开线下流量入口,乐摇摇完成亿元级B+轮融资
2026-05-25栏目: 教程
-
我所理解的《重说中国近代史》
2026-05-25栏目: 教程
-
给大家推荐8个SpringBoot精选项目
2026-05-25栏目: 教程
