Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet438/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   434   435   436   437   438   439   440   441   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 337 
]
Notice that there is no space in between the 
-p
 option and the actual password 
(though it's common to put a space between the 
-u
 option and the username). As 
useful as it is to provide the username and password in one shot, I don't recommend 
that you ever use that method. This is because any Linux command you type 
is saved in the history, so anyone can view your command history and they'll 
see the password in plain text. I only mention it here because I find that many 
administrators do this, even though they shouldn't. At least now you're aware of this 
method and why it's wrong.
The 
admin
 account we created is only intended for system administrators who 
need to manage databases on the server. The password for this account should not 
be given to anyone other than staff employees or administrators that absolutely 
need it. Additional users can be added to the MariaDB server, each with differing 
levels of access. Keep in mind that our 
admin
 account can manage databases but not 
users. This is important, as you probably shouldn't allow anyone other than server 
administrators to create users. You'll still need to log in as 
root
 to manage user 
permissions.
It may also be useful to create a read-only user for MariaDB for employees who need 
to be able to read data but not make changes. Back in the MariaDB shell (as 
root
), we 
can issue the following command to effectively create a read-only user:
GRANT SELECT ON *.* TO 'readonlyuser'@'localhost' IDENTIFIED BY 
'password'; 
With this command (and flushing privileges afterward), we've done two things. First, 
we created a new user and also set up grants for that user with a single command. 
Second, we created a read-only user that can view databases but not manage them 
(we restricted the permissions to 
SELECT
). This is more secure. In practice, it's better 
to restrict a read-only user to a
 specific database. This is typical in a development 
environment, where you'll have an application that connects to a database over the 
network and needs to read information from it. We'll go over this scenario soon.
Next, let's create a database. At the MariaDB prompt, execute:
CREATE DATABASE mysampledb; 
That was easy. We should now have a database on our server named 
mysampledb
. To 
list all databases on our server (and confirm our database was created properly), we 
can execute the following command:
SHOW DATABASES;


Managing Databases

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   434   435   436   437   438   439   440   441   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish