aliyun雲資料庫MySQL的備份檔案到自建資料庫
阿新 • • 發佈:2019-01-26
參考官方文件1: https://help.aliyun.com/knowledge_detail/41817.html?spm=5176.11065259.1996646101.searchclickresult.6a9a1949V5OLDw
快速操作: https://blog.csdn.net/zdb330906531/article/details/77479784?locationNum=5&fps=1
一,關於配置檔案,可以將如下內容加入到/etc/my.cnf (原datadir引數需要註釋掉),然後通過預設路徑啟動.
innodb_data_file_path=ibdata1:200M:autoextend
innodb_log_files_in_group=2
innodb_undo_directory=.
innodb_undo_tablespaces=0
datadir=/opt/alidata
二,建立新賬戶(所有恢復操作已完成):
1,許可權初始化:
delete from mysql.db where user<>'root' and char_length(user)>0;
delete from mysql.tables_priv where user<>'root' and char_length(user)>0;flush privileges;
2,建立開發只讀賬戶(程式呼叫):
grant select on *.* to 'dev_read'@'%' identified by 'xxxxx';
3,建立開發讀寫改賬戶(臨時維護):
grant all on history.* to 'dev_root'@'%' identified by 'xxxxx';