1209 - The MySQL server is running with the--read-only (二)
来源:互联网 发布:淘宝网平板电脑版 编辑:程序博客网 时间:2024/06/10 07:03
近日新上线的一个项目又遇到了数据库不能写入的情况。运维人员反映数据库不能写入,错误如下:
1209 - The MySQL server is running with the--read-only option so it cannot execute this statement引起这个问题的根本原因是数据库的read_only参数被打开,导致普通用户无法写入。检查了主库上的read_only参数,是关闭的,从库上的read_only是打开的。由此可以猜测是因为程序将写入操作连到了从库上。
运维人员检查了数据源的配置,发现写库和读库的配置的都是正确的。而且运维人员还反馈了一个现象,并不是所有的写操作都有问题,只有一个特定的操作会出现此问题。由此更加肯定不是数据库的问题了。但开发人员一口咬定是数据库权限给错了,不是程序的问题。直觉告诉我,跟这些人争论是没有用的。只有证明我们是对的,才能说服他们。
于是让运维人员将读库数据源指向实际的写库,如果应用正常,则证明是应用本身的问题。事实证明,按上述的方式修改后,应用运行正常,没有出现数据不能写入的情况。此时开发人员意识到是自己程序本身的问题,回去排查问题的原因了。
也许有人会问,这么低级的错误,怎么能上到生产环境上呢?难道没有经过测试吗?测试肯定是有的,并且也验证通过了。只是在测试环境中为了调试方便,他们硬编码了数据库的连接,并没有用到连接池。而生产环境中用了连接池,但他们又没有经过测试,所以便引发了上述问题。
没有规矩不成方圆,尤其是涉及到跨部门协作的工作,更应该严格按照规矩来办,不能图一时之快,而留下无穷后患。
0 1
- 1209 - The MySQL server is running with the--read-only (二)
- The MySQL server is running with the --read-only option so it cannot execute this statement
- 1209 - The MySQL server is running with the --read-only option so it cannot execute this statement
- Caused by: java.sql.SQLException: The MySQL server is running with the --read-only option so it cann
- MYSQL导入数据出现The MySQL server is running with the --secure-file-priv
- MYSQL导出数据出现The MySQL server is running with the --secure-file-priv option
- Error Code: 1290. The MySQL server is running with the --secure-file-priv op
- Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- 问题:The MySQL server is running with the --skip-grant-tables option
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option
- MySQL报错:The MySQL server is running with the --skip-grant-tables option so it cannot execute this st
- MySQL报错:The MySQL server is running with the --skip-grant-tables option so it cannot execute this st
- MySQL 报错Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- MYSQL导出数据出现The MySQL server is running with the --secure-file-priv option so it cannot execute this
- mysql错误:`The MySQL server is running with the --skip-grant-tables option so it cannot execute this s
- mysql 导出数据到文件 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so
- Windows下MySQL导入csv文件ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot exe
- web.xml 学习网址整理
- [leetcode oj 242]Valid Anagram
- 新装固态硬盘SSD,在安装WIN10,显示一直请稍后及Windows安装程序无法将Windows配置为此计算机的解决方法(网上都是胡诌)
- 快速排序
- Windows平台下安装Hadoop
- 1209 - The MySQL server is running with the--read-only (二)
- linux下rpm安装nginx
- caffe中cuda7.5的配置及python接口的使用--ubuntu14.04
- android studio引用项目作为library的具体操作步骤。
- iOS 支付宝支付以及各种错误解决方法!!!
- UIView的基本控件
- 重拾编程之路--leetcode(java)--输出单独出现的数组元素(1)
- nginx负载均衡配置
- Android DES,AES,RSA加密实现