当前位置:首页 > 开发 > 正文内容

服务器文件以及数据库备份

hackcode2023年09月15日 13:51开发467

数据库

导出

mysqldump -uroot -p123456 -A > /backup/all_db.sql

导入

mysql -u用户名    -p密码    <  要导入的数据库数据(runoob.sql)


文件备份

压缩文件夹

zip -r dir1.zip dir1

压缩文件

zip ana.zip anaconda-ks.cfg


忘记mysql root密码

停止mysql运行,启动安全模式

service mysql stop
mysqld_safe --skip-grant-tables &


进入mysql,5.7以上版本运行

mysql> update user set authentication_string=passworD("test") where user='root';
mysql>  FLUSH PRIVILEGES;

5.7以下

 mysql> use mysql;
 mysql> UPDATE user SET password=password("test123") WHERE user='root';   
 mysql> exit;


返回列表

上一篇:axios下载文件

下一篇:Google Auth