Posts

Showing posts with the label MySQL

https://www.vultr.com

The Everywhere Cloud

Deploy an instance.
Accelerate your application.


Uploading Old Data to a New MariaDB Database

Image
The following command-line procedure makes a database in MariaDB (previously MySQL) and populates it with content from a backup file. ========== user@host: $  mariadb -u root -p -h localhost MariaDB > CREATE DATABASE dbname; MariaDB > USE dbname; MariaDB > SELECT database(); -- Checks if the intended database is the one being used. MariaDB > SOURCE dirname/filename; -- Location of the backup file. MariaDB > SHOW tables; -- Verifies if the tables uploaded are from the backup file. MariaDB > GRANT ALL ON dbname.* TO 'username'@'localhost' IDENTIFIED BY 'password'; MariaDB > QUIT; ==========

Securing the MariaDB Server

Image
An easy way to secure the MariaDB (previously MySQL) server is to run the secure setup script in the command-line. ========== user@host: $  sudo mysql_secure_installation Remove anonymous users? (Press y|Y for Yes, any other key for No) : y -- The anonymous user, intended only for testing, allows anyone to log into the database. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y -- Allowing remote root login enables guessing of password from the network. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y -- The test database, also intended for testing, can be accessed by anyone. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y -- Reloading privileges implements the changes immediately. ==========