• 我的MySql掉队了


    本来今天高高兴兴,突然:

    raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
    django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1064, "You have an error in your SQL sy
    ntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL)' at line 1"))
    

    上网上搜寻一番,发现是MySql数据库与Django不兼容的原因,我的数据库是MySql Server 5.5版本,而Django2.0以后不再支持MySQL5.5,必须5.6版本以上,所以我下载了MySql 5.7.24。
    旧的MySql必须完全删除,清理干净需要删除注册表:

    win + R输入:regedit
    删除下面的目录
    HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesEventlogApplicationMySQL 
    HKEY_LOCAL_MACHINESYSTEMControlSet002ServicesEventlogApplicationMySQL
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlogApplicationMySQL
    或者使用能删除注册表的工具,例如UninstallTool;
    

    下载最新的MySql:

    https://dev.mysql.com/downloads/mysql/
    

    安装教程(转):

    https://blog.csdn.net/recky_wiers/article/details/79243804
    

    MySql密码忘记:

    关闭正在运行的MySQL服务
    win+R输入:cmd,转到mysqlin目录
    输入:mysqld --skip-grant-tables 回车     
    新打开dos窗口,转到mysqlin目录 
    输入mysql回车,显示已经进入mysql
    输入:use mysql;
    修改密码:
    update user set password=password("123456") where user="root"; 
    或者:
    update user set authentication_string=password("123456") where user="root";
    刷新权限:flush privileges; 
    关闭窗口,重新进入; 
    

    mysql里修改密码:

    set password for root@localhost = password('123456');
  • 相关阅读:
    二叉树的遍历
    数据结构
    POJ 2054 Color a Tree (贪心)
    $2019$ 暑期刷题记录 $2$(基本算法专题)
    POJ 3889 Fractal Streets(逼近模拟)
    POJ 2018 Best Cow Fences (二分答案构造新权值 or 斜率优化)
    CH5E26 扑克牌 (计数类DP)
    BZOJ 1911 特别行动队 (斜率优化)
    BZOJ 1233 干草堆 (单调队列优化DP)
    POJ 1038 Bugs Integrated Inc (复杂的状压DP)
  • 原文地址:https://www.cnblogs.com/dabaine/p/10112101.html
Copyright © 2020-2023  润新知