sourcecode

Showing posts with label Linux MySQL. Show all posts
Showing posts with label Linux MySQL. Show all posts

Thursday, June 28, 2012

Migrate MySQL database to a new server

How to move/copy/backup MySQL database to another server? Use mysqldump and ssh:

http://www.cyberciti.biz/faq/transferring-mysql-database-tables/
http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/

#mysqldump -u sqluser1 -psqlpass1 database1 |ssh sshuser@server2.com mysql -u sqluser2 -psqlpass2 thedatabase2
Then the terminal pops password entry for ssh for sshuser on server2.com

/******************END**************/

How to start MySQL service on Linux

http://theos.in/desktop-linux/tip-that-matters/how-do-i-restart-mysql-server/

Redhat/Fedora:
/etc/init.d/mysqld start
or
# service mysqld start
Debian/Ubuntu:
/etc/init.d/mysql start

To auto start MySQL after reboot:
http://www.nossdutytask.com/mysql/start_stop_and_auto_start_mysql_server_on_fedora_core_linux


1. The Linux command that can be use to check the list of service that start on certain run level:

[root@tenouk ~]# chkconfig --list

2. To check only MySQLd server:

[root@fedora ~]# chkconfig --list mysqld
mysqld       0:off       1:off       2:off       3:off       4:off       5:off       6:off
[root@fedora ~]#

3. To make MySQLd auto start when you boot your computer:

[root@fedora ~]# chkconfig --level 35 mysqld on

Note:   Run Level 3 = Full multiuser mode with no GUI
                  Run Level 5 = X11 or GUI mode

4. Use the chkconfig again to verify the changes:

[root@fedora ~]# chkconfig --list mysqld
mysqld       0:off       1:off       2:off       3:on       4:off       5:on      6:off


/************END*****************/