<\/span><\/h2>\n\n\n\nTo start the MariaDB service, execute the following command:<\/p>\n\n\n\n
sudo systemctl start mariadb<\/pre>\n\n\n\nTo enable the MariaDB service, execute the following command:<\/p>\n\n\n\n
sudo systemctl enable mariadb<\/pre>\n\n\n\nTo check the status of the MariaDB service, you can use the following command:<\/p>\n\n\n\n
sudo systemctl status mariadb<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@host:~# sudo systemctl status mariadb\n\u25cf mariadb.service - MariaDB 10.6.12 database server\n Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n Active: active (running) since Sun 2023-04-16 09:07:41 CDT; 16min ago\n Docs: man:mariadbd(8)\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Main PID: 79749 (mariadbd)\n Status: \"Taking your SQL requests now...\"\n Tasks: 7 (limit: 4571)\n Memory: 60.9M\n CPU: 1.087s\n CGroup: \/system.slice\/mariadb.service\n \u2514\u250079749 \/usr\/sbin\/mariadbd\n<\/pre>\n\n\n\nAnother way to check if the service is up and running is to execute the command below:<\/p>\n\n\n\n
sudo netstat -tunlp | grep mariadb<\/pre>\n\n\n\nYou will get output similar to this:<\/p>\n\n\n\n
root@host:~# sudo netstat -tunlp | grep mariadb\ntcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 79749\/mariadbd\n<\/pre>\n\n\n\nTo stop the service, you can use the following command:<\/p>\n\n\n\n
sudo systemctl stop mariadb<\/pre>\n\n\n\nNow, if you check the status, you will get an output similar to this:<\/p>\n\n\n\n
root@host:~# sudo systemctl status mariadb\n\u25cb mariadb.service - MariaDB 10.6.12 database server\n Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n Active: inactive (dead) <\/b>since Sun 2023-04-16 09:30:50 CDT; 4s ago\n Docs: man:mariadbd(8)\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Process: 79749 ExecStart=\/usr\/sbin\/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n Main PID: 79749 (code=exited, status=0\/SUCCESS)\n Status: \"MariaDB server is down\"<\/b>\n CPU: 1.206s\n<\/pre>\n\n\n\n<\/span>Step 5. Secure MariaDB installation<\/span><\/h2>\n\n\n\nAfter installation, we should secure the MariaDB installation with the following command:<\/p>\n\n\n\n
sudo mysql_secure_installation<\/pre>\n\n\n\nThere will be a couple of steps that you need to complete. First, hit enter since MariaDB is freshly installed, and there is no root password:<\/p>\n\n\n\n
root@host:~# sudo mysql_secure_installation\n\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\n SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!\n\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user. If you've just installed MariaDB, and\nhaven't set the root password yet, you should just press enter here.\n\nEnter current password for root (enter for none):\n<\/pre>\n\n\n\nIn the next step, follow the questions and bolded answers:<\/p>\n\n\n\n
OK, successfully used password, moving on...\n\nSetting the root password or using the unix_socket ensures that nobody\ncan log into the MariaDB root user without the proper authorisation.\n\nYou already have your root account protected, so you can safely answer 'n'.\n\nSwitch to unix_socket authentication [Y\/n] Y<\/b>\n\nEnabled successfully!\nReloading privilege tables..\n ... Success!\n\n\nYou already have your root account protected, so you can safely answer 'n'.\n\nChange the root password? [Y\/n] Y<\/b>\n\nNew password: Enter here strong MariaDB root password<\/b>\nRe-enter new password: Re-Enter here strong MariaDB root password<\/b>\nPassword updated successfully!\nReloading privilege tables..\n ... Success!\n\n\nBy default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem. This is intended only for testing, and to make the installation\ngo a bit smoother. You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] Y<\/b>\n\n ... Success!\n\nNormally, root should only be allowed to connect from 'localhost'. This\nensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] Y<\/b>\n ... Success!\n\nBy default, MariaDB comes with a database named 'test' that anyone can\naccess. This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] Y<\/b>\n - Dropping test database...\n ... Success!\n - Removing privileges on test database...\n ... Success!\n\nReloading the privilege tables will ensure that all changes made so far\nwill take effect immediately.\n\nReload privilege tables now? [Y\/n] Y<\/b>\n ... Success!\n\nCleaning up...\n\nAll done! If you've completed all of the above steps, your MariaDB\ninstallation should now be secure.\n\nThanks for using MariaDB!\n\n<\/pre>\n\n\n\n That was all. You successfully installed and secured MariaDB 9 on Ubuntu 22.04.<\/p>\n\n\n\n
If you do not want to configure it on your own, you can sign up for one of our NVMe VPS plans<\/a> and submit a support ticket. Our admins are available 24\/7 and will start work on your request immediately. Always trust our epic support.<\/p>\n\n\n\nIf you liked this post on how to install MariaDB on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"
In this tutorial, we are going to install in step-by-step detail the MariaDB database service on Ubuntu 22.04 OS. MariaDB … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":45535,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1702,13,1698],"tags":[296,59],"yoast_head":"\nHow to Install MariaDB on Ubuntu 22.04 - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n \n \n\t \n\t \n\t \n