Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Rl-004 error in MySQL

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the example analysis of R1004 error in MySQL, which is very detailed and has certain reference value. Friends who are interested must finish it!

When you install MySQL with the root user, a group named mysql and a system user named mysql are automatically created, but you cannot switch from the root user to the mysql user:

[root@hhu MySQL] # su-mysql

[root@hhu MySQL] # su-mysql

The reason is a problem with the Shell setting of the mysql user you just installed, as can be seen from the / etc/passwd file

[root@hhu home] # cat / etc/passwd

Root:x:0:0:root:/root:/bin/bash

Bin:x:1:1:bin:/bin:/sbin/nologin

Daemon:x:2:2:daemon:/sbin:/sbin/nologin

Adm:x:3:4:adm:/var/adm:/sbin/nologin

Lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

Sync:x:5:0:sync:/sbin:/bin/sync

Shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

Halt:x:7:0:halt:/sbin:/sbin/halt

Mail:x:8:12:mail:/var/spool/mail:/sbin/nologin

Uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin

Operator:x:11:0:operator:/root:/sbin/nologin

Games:x:12:100:games:/usr/games:/sbin/nologin

Gopher:x:13:30:gopher:/var/gopher:/sbin/nologin

Ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

Nobody:x:99:99:Nobody:/:/sbin/nologin

Dbus:x:81:81:System message bus:/:/sbin/nologin

Usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin

Rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin

Vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin

Rtkit:x:499:497:RealtimeKit:/proc:/sbin/nologin

Avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin

Abrt:x:173:173::/etc/abrt:/sbin/nologin

Saslauth:x:498:76: "Saslauthd user": / var/empty/saslauth:/sbin/nologin

Postfix:x:89:89::/var/spool/postfix:/sbin/nologin

Rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin

Nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

Ntp:x:38:38::/etc/ntp:/sbin/nologin

Apache:x:48:48:Apache:/var/www:/sbin/nologin

Haldaemon:x:68:68:HAL daemon:/:/sbin/nologin

Gdm:x:42:42::/var/lib/gdm:/sbin/nologin

Pulse:x:497:495:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin

Sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

Tcpdump:x:72:72::/:/sbin/nologin

Oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin

Hhu:x:500:500:hhu:/home/hhu:/bin/bash

Vboxadd:x:496:1::/var/run/vboxadd:/bin/false

Oracle:x:501:502::/home/oracle:/bin/bash

Mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/false

As you can see, the Shell attribute of the mysql user is / bin/false, which means: false-do nothing, unsuccessfully. You can use the usermod command to modify the Shell attribute of the mysql user and unlock the Shell.

[root@hhu home] # usermod-s / bin/bash mysql

[root@hhu home] # su-mysql

-bash-4.1$ cd

-bash-4.1$ ls

Auto.cnf ib_logfile0 performance_schema

Ca-key.pem ib_logfile1 private_key.pem

Ca.pem ibtmp1 public_key.pem

Client-cert.pem mysql server-cert.pem

Client-key.pem mysqld_safe.pid server-key.pem

Ib_buffer_pool mysql.sock sys

Ibdata1 mysql.sock.lock

-bash-4.1$ pwd

/ var/lib/mysql

-bash-4.1$ echo $HOME

/ var/lib/mysql

The above is all the contents of the article "example Analysis of R1004 errors in MySQL". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report