Recently, due to the need to test security products, I wanted to adjust the startup user of mariadb to root. After some twists and turns, I finally succeeded! Note: Starting MySQL as root is a very dangerous behavior, which is equivalent to giving the database operation user (database administrator or hacker) a channel to directly operate the system through MySQL! In fact, the official does not allow root boot, so in the normal boot mode, root boot will return a startup failure and prompt in /var/log/mariadb/mariadb.log Please consult the Knowledge Base to find out how to run mysqld as root! Ok, let's get to the point, about how to start Mariadb: Most people will do this: However, this instruction actually calls mariadb.service (use find to find the specific directory) to start mariadb. Modify the mariadb.service configuration as follows: [Unit] slightly [Service] Type=simple User=mysql is changed to User=root here || the startup user of the service Group=mysql is changed to Group=root || startup group of the service #Script to initialize mysql library files. If the mysql directory is not empty, it will prompt "Database Mariadb is probably initialized in /var/lib/mysql already, nothing is done". If you see this message when troubleshooting, you can ignore it. #Execute the mysqld execution script and do a security check. This file restricts root startup The following is omitted. . . #systemctl demon-reload #systemctl restart mariadb PS: The same operation method supports starting MySQL with other users. BUT The permissions or ownership of the two directories Summarize The above is the editor's introduction to the way to start mariadb under Linux using the root user. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: How to extend Vue Router links in Vue 3
>>: Vue mobile terminal determines the direction of finger sliding on the screen
Preface The three-column layout, as the name sugg...
The first step is to prepare an icon making softwa...
1. Install zabbix-agent on web01 Deploy zabbix wa...
Div solution when relative width and absolute wid...
You may not have had any relevant needs for this ...
We don't need to elaborate too much on the ad...
When Mysql associates two tables, an error messag...
Skip the Docker installation steps 1. Pull the po...
Table of contents In the React official website, ...
Whether the a tag opens a new page: (1) Baidu Ency...
Step 1: Add a secondary domain name to the Alibab...
Sometimes you need to install certain dependencie...
Table of contents Introduction Log classification...
Table of contents Preface React Functional Compon...
Checkboxes are very common on web pages. Whether ...