How To Create Database Backup from SSH


Step 1: Login to your server via SSH as root user. Step 2 Use below command to create / export a database. mysqldump database_name > /backup/database_name.sql Where database_name -> The name of database of which you want to create backup. /backup/database_name.sql -> Location and file name of database backup file.

How To Install MySQL on a CentOS Server

Following command will install MySQL on a CentOS server / VPS. Login to your server as root via SSH, and run following command. Step 1: yum install mysql-server service mysqld start Step 2: Set MySQL server root password. sudo /usr/bin/mysql_secure_installation MySQL server will ask MySQL server root password. Since you just installed mysql, there is […]

How to Start, Stop and Restart MySQL from SSH

Using below commands you can start, stop and restart MySQL from SSH. Login to your server as root via SSH, and run following commands. Start MySQL service mysql start OR /etc/init.d/mysql start Stop MySQL service mysql stop OR /etc/init.d/mysql stop Restart MySQL service mysql restart OR /etc/init.d/mysql restart Status of MySQL If you want to […]

How to find MySQL Error logs

If you want to see the list of MySQL errors on your server, please follow below steps. You can use tail or cat command to read the error log file. Tail command will display last 10 lines while cat command will display entire log file. Login to your server as root via SSH and run […]

How to run MySQLTuner on a cPanel server

MySQLTuner is great script to optimize mysql database of a server. It reports a large number of statistics and settings from your MySQL database engine, and then offers general recommendations to improve performance. To run MySQLTuner on a serve / VPS with cPanel, run following command in SSH /usr/local/cpanel/bin/ [vps_hosting]

How to change or move MySQL /tmp directory

This tutorial explains how you can change or move MySQL /tmp directory to a new location on a server / VPS. Login as root to your server via SSH. Step 1: Open /etc/my.cnf file for editing nano /etc/my.cnf Step 2: Add below line under the [mysqld] section and save the file. tmpdir=/home/mysqltmp To save file […]

How to move MySQL directory to /home

By default all MySQL database on a server is saved in /var/lib/mysql directory. If you don’t have enough space left in /var directory or if its filling up quickly, you can move your MySQL directory to /home partition. Assuming you have enough space in /home partition, follow below steps to move MySQL to a new […]

How to find MySQL root password

Server root MySQL password can be different from server root password. Here is how you can get root MySQL password. Login as root via SSH and execute following command tail /root/.my.cnf OR cat /root/.my.cnf This will show you the root MySQL password of your server. [dedicated_hosting]