May 24, 2021 That's what Linux should learn
Compared to MySQL, MariaDB database management systems have many new extension features, such as support for microsecond levels, thread pools, sub-query optimization, process reporting, and so on. Once the Yum software repository is configured, you are ready to install and deploy MariaDB database master and service-side programs.
After the installation is complete, remember to start the service program and add it to the boot item.
Install 2 Packages (+8 Dependent packages)
Total download size: 21 M
Installed size: 107 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------
Total 82 MB/s | 21 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
………………省略部分输出信息………………
Installed:
mariadb.x86_64 1:5.5.35-3.el7 mariadb-server.x86_64 1:5.5.35-3.el7
Dependency Installed:
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
perl-DBD-MySQL.x86_64 0:4.023-5.el7
perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-IO-Compress.noarch 0:2.061-2.el7
perl-Net-Daemon.noarch 0:0.48-5.el7
perl-PlRPC.noarch 0:0.2020-14.el7
Complete!
[root@linuxprobe ~]# systemctl start mariadb
[root@linuxprobe ~]# systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
Do not use the MariaDB database software program immediately after confirming that it has been installed and started successfully. I n order to ensure the security and functioning of the database, the database program needs to be initialized first. This initialization involves the following 5 steps.
Set the root administrator's password value in the database (note that the password is not the root administrator's password in the system, where the password value should be empty by default and you can press the enter key directly). S et the root administrator's proprietary password in the database. T he anonymous account is then deleted and the root administrator is used to log on to the database remotely to ensure the security of the business running on the database. D elete the default test database and cancel a series of access rights to the test database. R efresh the authorization list so that the initialization settings take effect immediately. For the above database initialization steps, Mr. Liu has made a simple comment next to the output information below to ensure that readers have a more intuitive understanding of what to enter:
[root@linuxprobe ~]# mysql_secure_installation /usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. ENTER CURRENT Password for root (enter for none): The current database password is empty, press the Enter key OK, SuccessFully Used Password, Moving on ... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y / N] Y NEW Password: Enter the database password to the root administrator RE-ENTER NEW Password: Enter the password PASSWORD UPDATED SUCCESSFULLY! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y / N] Y (Delete anonymous accounts) ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y / N] Y (Prohibition of the root administrator from logging in remote) ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y / N] Y (Delete Test Database and cancel access to it)
The root@linuxprobe root@linuxprobe is ready for everything. N ow we will log in to the Maria DB database for the first time. Where the -u parameter is used to specify login as root administrator, and the -p parameter is used to verify the user's password value in the database.
(root@linuxprobe) mysql -u root -p Enter password: Enter the root administrator's password welcome to the MariaDB monitor in the database here. C ommands end with ; o r \g. Your MariaDB connection id is 5 Server version: 5.5.35-MariaDB MariaDB Server Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others. T ype 'help; ' or '\h' for help. T ype '\c' to clear the current input statement. M ariaDB (none); when executing a database command after logging into the MariaDB database, you need to use a sign mark after the command (; A t the end, this is also the most significant difference from the Linux command. Y ou need to get used to this setting of database commands. Here's a command to see what databases are currently in the database management system:
MariaDB [(none)]> SHOW databases; + --------------------+ | D atabase | + --------------------+ | i nformation_schema | | m ysql | | p erformance_schema | A fter -------------------- the 3 rows in set (0.01 sec) calf, the next step is to use the database command to change the password value of the root administrator in the database management system to linuxprobe. If you log out and then try to sign in, you'll be prompted for a failed access if you insist on entering your original password.
MariaDB [(none)]> SET password = PASSWORD('linuxprobe'); Query OK, 0 rows affected (0.00 sec) MariaDB (none) and exit Bye (root@linuxprobe) - mysql -u root -p Enter Password: Enter the root administrator's new password in the database HERE ERROR 1045 (28000): Access denied for user 'root' s 'localhost' (US: YES)