In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Ubuntu how to install MariaDB, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Install MariaDB
Wuxiangping@linuxcool:~$ sudo apt updatewuxiangping@linuxcool:~$ sudo apt install mariadb-server
After the installation is complete, the MariaDB service starts automatically.
Verify the database server running status
Wuxiangping@linuxcool:~$ sudo systemctl status mariadb.service
View the database version number
Wuxiangping@linuxcool:~$ mysql-versionmysql Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86 / 64) using readline 5.2
MariaDB security configuration, initializing data
The MariaDB server package comes with a script called mysql_secure_installation, which can easily improve the security of the database server.
Wuxiangping@linuxcool:~$ sudo mysql_secure_installationNOTE: 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 currentpassword for the root user. If you've just installed MariaDB, andyou 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): directly enter OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.You already have a root password set, so you can safely answer 'n'.Change the root password? [root] y set the root user password New password: Re-enter new password: Password updated fulfilled Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [YBO] y deletes anonymous users... Successful normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [YBO] y forbids root original connections. Successful by default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [YBO] y delete the default test database name-Dropping test database... ... Success!-Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? The refresh will take effect immediately. Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!
Local root user login
Shell interoperates with MariaDB, and the runtime will prompt for the password of the system user name.
Wuxiangping@linuxcool:~$ sudo mysql [sudo] wuxiangping password: Welcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 49Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.MariaDB [(none)] >
Authorize MariaDB to specify host remote access
The default listening port is 127.0.0.1, which needs to be modified to host IP
Change wuxiangping@linuxcool:~$ sudo vim / etc/mysql/mariadb.conf.d/50-server.cnfbind-address=127.0.0.1 to bind-address=192.168.3.22
MariaDB [(none)] > use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedMariaDB [mysql] > GRANT ALL PRIVILEGES ON *. * TO 'root'@'192.168.3.8' IDENTIFIED BY' password' WITH GRANT OPTION;Query OK, 0 rows affected (0.00 sec) MariaDB [mysql] > flush privileges;Query OK, 0 rows affected (0.00 sec) MariaDB [mysql] > select host, user from user; # View MySQL database user table
Restart the mariadb service
Wuxiangping@linuxcool:~$ sudo systemctl restart mariadb.service
Remote host connection test
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.