目录

72.1. Reset root password 重置MySQL root密码72.2. 数据库内容替换72.3. 查看错误代码
72.3.1. ERROR 1153 (08S01) at line 3168: Got a packet bigger than 'max_allowed_packet' bytes72.3.2. ERROR 1129 (00000): Host 'XXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
72.4. 临时表是否需要建索引72.5. Kill 脚本72.6. ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function72.7. ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.72.8. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements72.9. 重新整理AUTO_INCREMENT字段72.10. 转换 latin1 到 UTF-872.11. this is incompatible with sql_mode=only_full_group_by72.12. [Warning] Changed limits: max_open_files: 5000 (requested 20480)72.13. ERROR 1364: 1364: Field 'id' doesn't have a default value72.14. ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement72.15. ERROR 1086 (HY000): File '/var/lib/mysql-files/order.txt' already exists 72.16. ERROR 1415: Not allowed to return a result set from a trigger

72.1. Reset root password 重置MySQL root密码

忘记root密码是使用 --skip-grant-tables 启动项

CentOS 6.x

# vim /etc/init.d/mysqld$exec --skip-grant-tables  --datadir="$datadir" --socket="$socketfile" \--pid-file="$mypidfile" \--basedir=/usr --user=mysql >/dev/null 2>&1 &
# /etc/init.d/mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]# mysqladmin -u root flush-privileges password "newpassword"

CentOS 7.x

添加 skip-grant-tables=1 选项,然后重启mysql

# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables=1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# systemctl restart mysqld
update mysql.user set authentication_string=password('netkiller') where user='root' and Host = 'localhost';
flush privileges;
quit;
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.14 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> update mysql.user set authentication_string=password('netkiller') where user='root' and Host = 'localhost';
Query OK, 1 row affected, 1 warning (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 1mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> quit;
Bye

删除 skip-grant-tables=1 重启MySQL

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

第 72 章 FAQ相关推荐

  1. 【STM32H7教程】第72章 STM32H7的SPI总线基础知识和HAL库API

    完整教程下载地址:http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980 第72章       STM32H7的SPI总线基础知识和HA ...

  2. 第 133 章 FAQ

    133.1. Haproxy 与 Nginx Haproxy 与 Nginx 都能实现负载均衡,那么 Haproxy 与 Nginx proxy 有什么差异,我们怎样选择两种方案. 如果是用于 HTT ...

  3. PLSQL入门与精通(第72章:LOGOFF触发器)

    上一次我们介绍了登录触发器,本次我们介绍注销触发器. 我们这里的注销指的是退出回话或者退出回话的意思. 注销触发器是用户退出回话或者数据库数据库时启动的触发器. 他是会话结束前的最后一步处理. 登录触 ...

  4. stm32h7高速通信_【STM32H7教程】第75章 STM32H7的SPI总线应用之驱动DAC8501(双路输出,16bit分辨率,0-5V)...

    第75章       STM32H7的SPI总线应用之驱动DAC8501(双路输出,16bit分辨率,0-5V) 本章节为大家讲解标准SPI接线方式驱动模数转换器DAC8501,制作了中断和DMA两种 ...

  5. 【STM32H7教程】第94章 STM32H7的SPI总线应用之双机通信(DMA方式)

    完整教程下载地址:链接 第94章       STM32H7的SPI总线应用之双机通信(DMA方式) 本章节为大家讲解SPI DMA方式双机通信. 目录 94.1 初学者重要提示 94.2 SPI D ...

  6. 【STM32H7教程】第74章 STM32H7的SPI总线应用之驱动DAC8563(双通道,16bit分辨率,正负10V)

    完整教程下载地址:http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980 第74章       STM32H7的SPI总线应用之驱动DA ...

  7. 81章 老子1章到_老子道德经第1---81章原文及译文

    老子简介老子名言道德经简介道德经全文及译文 道德经下载道德经全文讲解道德经朗读(道篇)|(德篇)道德经译文精简版 道德经逐句翻译道德经与风水学"道"的意思人生感悟 老子故里老子的思 ...

  8. gradle新建工程,多项目依赖,聚合工程

    感谢gradle完全的文档.开始完全没想过新建项目会弄我一天时间,都说gradle构建项目简单,我现在回复他们呵呵. gradle是个非常复杂的工具,从他的完整包80M和72章官方文档就可以看出一二. ...

  9. noip2018——题解总结

    近期正在疯狂复习某些东西,这篇博客尽量年底更完--(Day2T2除外) 好了,所有的希望都破灭了,原来这就是出题人的素质.--一个被欺骗的可怜 $OIer$ 人生中倒数第三次 $noip$ (Mayb ...

最新文章

  1. C#筛法求出范围内的所有质数
  2. linux中将文本中的单词换掉的指令_从零开始学Linux运维|19.文本处理相关命令(2)...
  3. Linux中查看各文件夹大小(扫盘)
  4. 【如何选】2019我的手机功能需求,千元机功能需求分析手机对比
  5. 分区供水条件口诀_经典口诀2020年一建市政管道篇
  6. java 多线程池_Java项目中,线程池中线程数量太大会有什么影响?
  7. Wayland 协议的解析
  8. oracle 德文符号处理_南沙区专业高效的化妆废水处理操作简单
  9. 云端软件平台 如何共享自己封装的云端软件
  10. 使用 CP2102通过串口下载程序到STM32F103中 (MCUISP)
  11. postman并发测试_PostMan接口压力测试
  12. 如何快速提取手机微信数据?
  13. java fup spring
  14. 正方教务隐藏入口_正方教务系统小功能操作手册
  15. Linux网络代理服务器搭建及使用
  16. arccotx图像在matlab,反三角函数图像与性质是什么?
  17. Python数据结构04-冒泡、选择、插入、归并、希尔、快速排序、二分查找
  18. CDA数据分析师深圳校区就业班第17期正式开班!
  19. 发布Windows应用程序!试试英伟达“神笔马良”GauGAN
  20. NO.007-2018.02.12《白头吟》两汉:卓文君

热门文章

  1. 令人惊奇的FLEX 3D UI.
  2. 新网域名服务故障的N种可能
  3. Linux命令总结(之二)Find
  4. opencv3.2+opencv_contrib+cmake
  5. SAP HANA Cloud Connector图文全攻略
  6. Spark1.5.1学习笔记汇总
  7. 基于Adobe LCDS产品的数据访问解决方案Part4
  8. javaweb + websocket实现客户端
  9. 周志华-机器学习西瓜书-第三章习题3.3 编程实现对率回归
  10. linux云自动化运维基础知识4(系统结构,vim,管理输入输出,正则表达式)