当前位置:网站首页>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
边栏推荐
- [Linux] install MySQL
- Shardingproxy sub database and table actual combat and comparison of similar products
- Establishment of NFS server
- Kgdb debug kernel cannot execute breakpoints and kdb-22:permisson denied
- [brother hero June training] day 23: dictionary tree
- TDengine 商业生态合作伙伴招募开启
- Apache cannot start in phpstudy
- 让人深思:句法真的重要吗?邱锡鹏组提出一种基于Aspect的情感分析的强大基线...
- [intensive reading of thesis]bert
- 开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
猜你喜欢

Metasploit Eternal Blue attack

Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions

免费 DIY 之旅问题

Tdengine helps Siemens' lightweight digital solution simicas simplify data processing process

ctf (hardrce)

已解决SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated

招聘顶尖人才!旷视科技“MegEagle创视者计划”正式启动

Pyqt5 rapid development and practice 4.2 QWidget

Warning: remote head references to nonexistent ref, unable to checkout error messages

TDengine 助力西门子轻量级数字化解决方案 SIMICAS 简化数据处理流程
随机推荐
Loop traversal of foreach and some of ES6
Matlab- draw date and duration diagram
File upload vulnerability related
Alibaba mailbox web login turn processing
[shutter] SharedPreferences
No Identifier specified for entity的解决办法
游戏玩家问题
[brother hero June training] day 23: dictionary tree
数据类型与变量
warning: remote HEAD refers to nonexistent ref, unable to checkout报错信息
[brother hero June training] day 24: line segment tree
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
Metaaploit post penetration technology knowledge
Wind10 configure ADB command
Basic statement of database operation
ctf (hardrce)
Matlab draws the system response under different damping
服务器访问速度
[Linux] install redis
tf.AUTO_ Function of reuse