Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet437/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   433   434   435   436   437   438   439   440   ...   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)

[
 336 
]
As I mentioned, the previous command created the 
admin
 user but is only allowing it 
to connect from 
localhost
. This means that an administrator would first need to log 
in to the server itself before they would be able to log in to MariaDB with the 
admin
 
account. As an example of the same command (but allowing remote login from any 
other location), the following command is a variation that will do just that:
CREATE USER 'admin'@'%' IDENTIFIED BY 'password'; 
Can you see the percent symbol (
%
) in place of 
localhost
? That basically means 
everywhere
, which indicates we're creating a user that can be logged in to from any 
source (even external nodes). However, by restricting our user to 
localhost
 with the 
first command, we're making our server just a bit more secure. You can also restrict 
access to particular networks, which is desired if you really do need to allow a 
database administrator access to the server remotely:
CREATE USER 'admin'@'192.168.1.%' IDENTIFIED BY 'password'; 
That's a little better, but not as secure as limiting login to 
localhost
. As you can see, 
the 
%
 character is basically a wildcard, so you can restrict access to needing to be 
from a specific IP or even a particular subnet.
So far, all we did is create a new user; we have yet to give this user any permissions. 
We can create a set of permissions (also known as 
grants
) with the 
GRANT
 command. 
First, let's give our admin user full access to the database server when called from 
localhost
:
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'; 
FLUSH PRIVILEGES; 
Now, we have an administrative user we can use to manage our server's databases. 
We can use this account for managing our server instead of the 
root
 account. Any 
logged-on Linux user will be able to access the database server and manage it, 
provided they know the password. To access the MariaDB shell as the 
admin
 user 
that we created, the following command will do the trick:
mariadb -u admin -p 
After entering the password, you'll be logged in to MariaDB as 
admin
.
In addition, you can actually provide the password to the 
mariadb
 command without 
needing to be prompted for it:
mariadb -u admin -p
 


Chapter 13

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   433   434   435   436   437   438   439   440   ...   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