当前位置:网站首页>How to modify the strict mode under MySQL so that adding new users by inserting user table is successful
How to modify the strict mode under MySQL so that adding new users by inserting user table is successful
2022-07-27 10:50:00 【Golden% sunset】
How to do mysql Strict mode modification under , Make it possible to add new users by inserting them into the user table
Method 1 Modify global variables sql_mode
By modifying global variables sql_mode To realize the modification of strict mode , So as to add new users by inserting the user table .
First, insert the user table to create the user
As can be seen from the above , At this time, it is not allowed to insert the user table to create a new user , This is because mysql5.7 Cannot be used in the default strict mode insert Statement to create a user's .
resolvent :
take sql_mode It is amended as follows NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION.
Check the current sql_mode
show variables like "sql_mode%";
modify sql_mode value
set global sql_mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
Enter again and use again insert Create users in the same way
thus it can be seen , This method doesn't work , Modify the global variable method to realize insert Statement insertion failed .
Method 2 modify mysql The configuration file
stay mysql In the configuration file mysql The strict pattern in , So as to achieve insert Statement create user .
stay windows Under the system ,mysql The default configuration file name of is my.ini
stay Linux Under the system ,mysql The default configuration file name of is my.conf/my.cnf
sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Modify if any , If not, then [mysqld] Add .
Restart after adding mysql service , Again using insert Create users in the same way .
Add user successfully
Refresh permission table 
sign out mysql Log in with the newly created user
Login successful
边栏推荐
- Share machine learning notes (PDF version) + practical projects (dataset + code)
- Learning C language together: structure (2)
- MySQL数据表的高级操作
- 家庭琐事问题
- Distributed block device replication: client
- Matlab discrete event system simulation experiment
- Matlab/simulink sample sharing for solving differential equations
- kgdb调试内核无法执行断点及kdb-22:Permisson denied
- 想要一键加速ViT模型?试试这个开源工具!
- How to smooth the online and offline of Web Services
猜你喜欢

Want to speed up the vit model with one click? Try this open source tool!

Data types and variables

Metasploit Eternal Blue attack

Tcp/ip protocol

开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能

WebRTC实现简单音视频通话功能

Samba server

Local connection to remote server database under Windows platform (I)

Li Kou brush question 02 (sum of three numbers + sum of maximum subsequence + nearest common ancestor of binary tree)

Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 1)
随机推荐
MySQL日志管理、备份与恢复
Recruit top talents! The "megeagle creator program" of Kuangshi technology was officially launched
Metaaploit post penetration technology knowledge
异构计算技术分析
Matlab sound classification based on short-time neural network
全校软硬件基础设施一站式监控 ,苏州大学以时序数据库替换 PostgreSQL
Gamer questions
Local connection to remote server database under Windows platform (I)
It is thought-provoking: is syntax really important? Qiu Xipeng group proposed a powerful baseline for aspect based emotional analysis
Shardingproxy sub database and table actual combat and comparison of similar products
No Identifier specified for entity的解决办法
7z usage
ctf (hardrce)
The core concept and fast practice of shardingsphere
How to smooth the online and offline of Web Services
ASP.NET Core依赖注入之旅:1.理论概念
Shardingsphere kernel principle
warning: remote HEAD refers to nonexistent ref, unable to checkout报错信息
flask_ Output fields in restful (resources, fields, marshal, marshal_with)
[Select] how to write PHP code perfectly?