Learning Mysql


!3and press the Enter key.Performing restricted operations



Download 4.24 Mb.
View original pdf
Page22/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   18   19   20   21   22   23   24   25   ...   366
Learning MySQL
!3
and press the Enter key.
Performing restricted operations
Certain restricted operations on a Linux or Mac OS X system are allowed only if you have superuser, or root, privileges. On a Linux system, you can login as the system root
14 | Chapter 2:
Installing MySQL

user by typing the su -switch user) command. When prompted, type in the system root user’s password and press the Enter key:
[adam@eden
]$ su -
Password: the_system_root_password
[root@eden This is almost identical to the case for Mac OS X:
eden:
adam$ su -
Password: the_system_root_password
eden:
root#
After you type in the password, you’ll be logged in as the user root on the same computer (in this example, eden
) and be working from that user’s home directory (also indicated by a tilde).
Notice how the last character of the prompt is a dollar sign (
$
) when you’re not the root user and the hash or pound (
#
) sign when you are. In this book, we’ll use these symbols to indicate whether you should run a certain command as an ordinary user or as the root user. When you’ve finished doing the restricted operations, you can logout from the system root account by typing
exit
:
# exit
$
You can generally use the sudo command to perform actions with system superuser privileges, even though you’re not actually logged in as root. You can also use the sudo
-s command to login as the root user (in place of su -
). If you login as the system root user, you can then omit the sudo keyword. Again, we emphasize that you can inadvertently do a great deal of damage if you use the root account, and we recommend that you login as the system root user as infrequently as you can. Some configuration is necessary to allow ordinary Linux users to use the sudo command, but it’s enabled by default under Mac OS X, and we’ll use this approach when discussing installation for this operating system.
You can add the ampersand symbol (
&
) at the end of a command to start the command in the background, allowing you to use the shell for other work. It’s better to avoid using this symbol in conjuction with the sudo command, since you won’t see any system prompt for you to enter your password. When we want you to run a sudo job in the background, we’ll ask you to start the job normally, then press the CTRL-Z key combination to suspend this new job. You can then type the command

Download 4.24 Mb.

Share with your friends:
1   ...   18   19   20   21   22   23   24   25   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page