mysql

MySQL on a Server

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
mysql -u username -p

/etc/init.d/mysqld stop
/etc/init.d/mysqld start
/etc/init.d/mysql restart
/etc/init.d/mysql status

service mysqld start
service mysqld stop
service mysqld restart
service mysqld status
cannot get the mysql service to restart
Another MySQL daemon already running with the same unix socket.
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak

Copy a Database

mysqldump -u username -p databasename > nameofbackuql
mysql -u user -p -h datbasehost databasename < nameofbackup.sql
Tar up the database folder (tar -cf joom.tar joom)
Scp the tar file over to the new server (scp jo om.tar root@ip.ip.ip.ip:/var/lib/mysql)
Untar it and move the contents to the new joom folder. (tar -xvf joom.sql)

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
show databases;
mysql -uadmin -p`cat /etc/psa/.psa.shadow` admin_massageworks > admin_massageworks.sql

Take a Databse Dump

With Plesk

mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` DATABASE_NAME > FILE_NAME.sql

Without Plesk

mysqldump -u root -p edpacouk_projects > /home/edpacouk_projects.sql