Introduction
There are a number of reasons you might need a clean installation of a database server on your Stack. Perhaps your application has begun to scale and you need to separate your database server from your application server. Maybe you want to try experiment with new MariaDB features or need to test out some unknown syntax. Either way, Stack Harbor has made it easy for you to deploy a simple MariaDB server in just a couple of minutes using our turnkey Stacks.
Accessing Your Database Stack
Once your stack is built, we’ll need to SSH into the machine to gain access to privileged information such as the root password and the administrative password, which we recommend you use in place of the root account for security hardening purposes. If you don’t know how to SSH into your machine, we’ve written to a detailed tutorial to help you get started.
As soon as you SSH into your machine, you should see your access credentials echoed in the message of the day (MOTD). Consider taking note of these credentials somewhere secure and removing the message of the day. You can do so by running the rm -f /etc/motd command in your shell. To access the MariaDB client, run the following command:
mysql -u admin --password=[password]
For future references, replace admin with the user with which you wish to login and replace ‘[password]’ with the associated password for that account. As soon as you execute that command, you should enter the MySQL shell and be able to perform basic queries on your database server. Run show databases; to echo a list of all databases currently on your server. To select a database in order to query it, use the command use [dbname] replacing [dbname] with the appropriate database. Your MySQL prompt should change to reflect what database you’re currently using.
Final Words
Congratulations! You’re all set up with a clean installation of MariaDB. From here on you can connect an external application to make database read/writes, test out SQL syntax and features, or install additional packages on top of your MariaDB module in order to build your very own Stack. Check out our Community Section for more information on how to secure your MariaDB server among other administrative and development tasks. From all of us at Stack Harbor, yarrr!
No Comments
Be the first to start a conversation