wujianjun@wujianjun-work:~$ sed -i "s/原内容/新内容/g" service_module_db_init.sql wujianjun@wujianjun-work:~$ find . -type f -name "app" -exec sh {} restart \; #批量执行shell
通过mysql命令恢复备份文件
1
wujianjun@wujianjun-work:~$ mysql -uroot -p --default-character-set=utf8 < service_module_db_init.sql
忘记MySQL的root密码后修改密码
1 2 3 4 5 6 7 8
wujianjun@wujianjun-work:~$ service mysql stop wujianjun@wujianjun-work:~$ mysqld --console --skip-grant-tables --shared-memory wujianjun@wujianjun-work:~$ mysql -u root -p mysql> use mysql; mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '新密码'; mysql> flush privileges; mysql> exit wujianjun@wujianjun-work:~$ service mysql start