Pages

Wednesday, October 30, 2013

Using mysqldump - How to back up a MySQL database on Linux with the mysql dump command


You do not need to invoke the mysql command or log into your MySQL server..
From your linux shell command line type:

MyLinuxServer:/ # mysqldump -u root -p  databaseName > databaseBackupFileName.sql;

You will be prompted to enter the password next "Enter password:"

View all MySQL databases - SQL command to show databases on MySQL Linux

Once you log into MySql,

mysql> SHOW DATABASES;

Log into a MySQL server

Command:

MyLinuxServer:/ # mysql -u root -p


You will be prompted to enter the password "Enter password:"  next



Tuesday, October 22, 2013

Stop, Start, Restart, Status of MySQL server



I've tired many commands, I find these to work the best using the Sys-V init scripts located in /etc/init.d.

Start:
sudo /etc/init.d/mysql start
Stop:
sudo /etc/init.d/mysql stop
Restart / reload configs:
sudo /etc/init.d/mysql restart
Check run status:
sudo /etc/init.d/mysql status