Restoring MySQL Databases Question
Hi,
I was trying to restore/sync all databases from server1 to server2 which has some more mysql users than the server2. Whenever I do the restoration, users which are not present in the server1 are getting deleted from the server2 Db.
I am using this command to restore the Db " mysql -u root -p < DB_Sunday_2.sql "
Will it overwrite the existing tables or append it? If it overwrites why there is change in size of files in /var/lib/mysql on both servers?
-----------------------------------------------------------------------------------------
mysql Ver 14.14 Distrib 5.6.34, for Linux (x86_64) using EditLine wrapper
Any helps appreciated
-
Hello, Database users should be added through the cPanel interface or via a cPanel UAPI command to ensure they are compatible with cPanel: UAPI Functions - Mysql::create_user - Software Development Kit - cPanel Documentation Additionally, you should use the database mapping tool if you want to assign database users to databases: The dbmaptool script - Documentation - cPanel Documentation Thank you. 0 -
Hi, How to take a complete db backup except one (say mysql)? 0 -
Try with following command. Update your correct MySQL root password (-proot) in this command. echo 'show databases;' | mysql -uroot -proot | grep -v ^Database$ | grep -v ^information_schema$ | grep -v ^mysql$ | xargs mysqldump -uroot -proot --databases > all.sql0
Please sign in to leave a comment.
Comments
3 comments