mysql RDS数据库恢复
最近在恢复阿里云RDS数据库,操作如下:
1,下载备份文件
[client]
default-character-set = utf8
[mysqld_multi]
mysqld = /usr/local/lnmp/mysql/bin/mysqld_safe
mysqladmin = /usr/local/lnmp/mysql/bin/bin/mysqladmin
user = root
[mysqld1]
port = 3306
socket = /tmp/mysql.sock
datadir = /date/lnmp/mysql
pid-file = /date/lnmp/mysql/mysql1.pid
log-error = /date/lnmp/log1/mysql_error.log
skip-locking
max_connections = 600
event_scheduler=ON
server-id = 1
[mysqld2]
port = 3307
socket = /tmp/mysql2.sock
datadir = /mysql2
pid-file = /mysql2/mysql.pid
log-error = /date/lnmp/log1/mysql_error2.log
innodb_data_file_path=ibdata1:200M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=1048576000 #这三行很重要,在/mysql2/mysql-my.cnf中有,复制过来就可以了,不然innodb表打不开
启动实例
/usr/local/lnmp/mysql/bin/mysqld_multi --defaults-file=/etc/my.cnf start 1
/usr/local/lnmp/mysql/bin/mysqld_multi --defaults-file=/etc/my.cnf start 2
停止实例方法
kill -9 `ps -ef | grep 3307 | grep -v grep | awk ‘{print $2}‘ | xargs`
修改mysql数据库用户名
mysql -uroot -proot -S /tmp/mysql2.sock
grant all on *.* to root@‘localhost‘ identified by ‘password‘
4,以上第3步是针对一台多个实例,如果就一个实例的话就不需要那么麻烦了,第3步就是如下了:
vi /etc/my.cnf
[mysqld]
********
innodb_data_file_path=ibdata1:200M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=1048576000 #只要加这三行就可以了
********
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。