mysql-backup restore
java library : /usr/share/tomcat6/lib
tomcat path in ubuntu : /var/lib/tomcat6/webapps/
Old server cp working.sql /hr/working.sql
mysqldump -uUsername -pPassword --opt SourceDatabaseName > fileName.sql
New Server
shell#useradd
shell#passwd
shell#rsync -av OldServerUserName@192.168.10.80:/hr/ /var/lib/tomcat6/webapps/hr/
shell# vi /server.xml
<Context path="/hr" docBase="hr"
debug="0" crosscontext="true" reloadable="true">
</Context>
shell#ln -s /var/lib/tomcat6/webapps/hr /hr
shell#sudo dpkg-reconfigure mysql-server-5.5 ## change password
shell#mysql -uroot -UserPassword
mysql>create database hr;
mysql>use hr;
mysql> source /hr/working.sql
cp oldServer
/usr/share/tomcat6/lib/*
to newServer
ubuntu-mysql
inf : https://help.ubuntu.com/lts/serverguide/mysql.html
sudo apt-get install mysql-server
sudo r| grep mysql ## check whether the MySQL server is running
sudo service mysql restart
/etc/mysql/my.cnf ## configuration mysql-config
bind-address = 192.168.0.5
sudo service mysql restartsudo dpkg-reconfigure mysql-server-5.5 ## change the MySQL root password
mysqldump --all-databases --all-routines -u root -p > ~/fulldump.sql
sudo service mysql stop
Now backup the original my.cnf file and replace with the new one:
sudo cp /etc/my.cnf /etc/my.cnf.backup
sudo cp /path/to/new/my.cnf /etc/my.cnf
沒有留言:
張貼留言