Skip to main content

Posts

Showing posts with the label MariaDB

How to Secure MariaDB for VestaCP and CWP ?

If you are using VestaCP or CentOS Webpanel then this tutorial will guide you through some basic steps you can take to secure your MariaDB or MySQL databases, and ensure that they are not an open door into your VPS. However, like most software, these tools can be security liabilities if they are configured incorrectly. For the sake of simplicity and illustration, we will use the MariaDB 10.1 server on a CentOS 7.6 VPS instance. Now run the script called "mysql_secure_installation". This will guide us through some procedures that will remove some defaults that are dangerous to use in a production environment. # mysql_secure_installation It will first prompt you for the root password you set up during installation. Immediately following, you will be asked a series of questions, beginning with if you'd like to change the root password. This is another opportunity to change your password to something secure if you have not done so already. You should answer "Y

How to find out & Change VestaCP MySQL/MariaDB root Password ?

If you forget the MySQL/MariaDB root password, no worries to find out the mysql root password. The password is stored at: /usr/local/vesta/conf/mysql.conf and /root/.my.cnf Before do anything , create a backup file. # cp /usr/local/vesta/conf/mysql.conf /usr/local/vesta/conf/mysql.conf.bak # cp /root/.my.cnf /root/.my.cnf.bak Use this syntax to change MySQL/MariaDB root password # mysqladmin -u root -pOLDPASSWORD password 'NEWPASSWORD' Change the root password # mysqladmin -u root -pgX7wlY5V3F password 'gR7wlY6V9A' Now Update the newly changed password # vi /usr/local/vesta/conf/mysql.conf HOST='localhost' USER='root' PASSWORD= 'gR7wlY6V9A' CHARSETS='UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8' MAX_DB='500' U_SYS_USERS='admin,datahead' U_DB_BASES='3' SUSPENDED='no' TIME='15:10:16' DATE='2019-04-17' # vi /root/.my.cnf [client] password= 'gR7wlY6V9A'