PHPstudy2018最新版里mysql5.51升级到mysql5.7.24解决办法

    我本地的phpstudy是2018版本的的mysql版本是mysql5.51的,现在从其他地方导入mysql5.7以上的sql会出现

错误代码: 1293 
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause )

有些导入不进去,因此解决方案把phpstudy默认的MySQL5.51版本升级为mysql5.7.24,首先去mysql官网下载https://dev.mysql.com/downloads/file/?id=481160我下载的版本是:mysql-5.7.24-winx64.zip
一:把原来MySQL备份为MySQL_back
二:把mysql-5.7.24-winx64.zip解压到D:\phpstudy\PHPTutorial并改名为MySQL
三:从MySQL_back里拷贝一个my.ini放到D:\phpstudy\PHPTutorial\MySQL\bin目录里,高版本里my.ini需要放到bin目录里

复制下方代码直接覆盖my.ini,其中只需注意

basedir="D:/phpstudy/PHPTutorial/MySQL/"

datadir="D:/phpstudy/PHPTutorial/MySQL/data/"

换成你自己的实际目录位置

  [client]
port=3306
[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir="D:/phpstudy/PHPTutorial/MySQL/"
datadir="D:/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:/phpstudy/PHPTutorial/MySQL/data/error.log

四:然后已管理员身份运行cmd

   先从c盘切换到 d:盘
   进入这个目录:cd  phpstudy/PHPTutorial/MySQL/bin
   初始化mysql
   mysqld --initialize-insecure --user=mysql

(这步可能会出现提示由于找不到MSVCR120.dll和MSVCP120.dll,无法继续执行代码 是因为你win10系统缺乏一些库文件直接下载安装一下链接http://www.pc6.com/softview/SoftView_104246.html就好了)
   安装mysql5.7服务
   mysqld –install

   启动mysql
   net start mysql

五:登入mysql并修改密码
  mysql -u root -p
  直接回车,因为配置文件里配置了不进行登录验证 (skip-grant-tables = 1 #跳过权限验证)
  进入mysql后执行:ALTER USER USER() IDENTIFIED BY 'root';修改root密码
六:问题产生: 
安装好phpstudy后,升级了MySQL后,通过phpstudy启动,Apache可以启动,Mysql无法启动。
解决方法: 
之前已经装过Mysql,要把系统服务里面的MySQL删除,留下MySQLa服务。 
在cmd命令行下输入:sc delete mysql 即可删除。

OK

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

钟长森

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值