mysql 数据库名字 mac,【已解决】Mac本地给mysql数据库改名
折騰
期間,需要去備份在線mysql,恢復導入到Mac本地的mysql
但是同時保留Mac本地之前的mysql的數據庫,用于對比查找問題
所以需要去:
mysql 數據庫 改名
mysql database rename
感覺此處還是用mysqldump比較省事。
去看看:
mysqldump -R old_db | mysql new_db
【總結】
此處Mac中本地mysql去改名,最簡單的還是:mysqldump -u username -p -v olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql
詳細過程:???mysql_backup_restore mysqldump -uroot -pcrifan_mysql -v naturling > local_mysql_naturling.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Connecting to localhost...
-- Retrieving table structure for table auth_group...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table auth_group_permissions...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table auth_permission...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table django_admin_log...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table django_content_type...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table django_migrations...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table django_session...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table django_site...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table enum_value_dict...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table keyword...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table keyword_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table media...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table media_keyword_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table media_scene_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table qa...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table qa_keyword_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table qa_scene_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table scene...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table scene_keyword_rel...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table script_dialog...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table script_history...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table script_review...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table script_script...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table thesaurus...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table user_functiongroup...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table user_functiongroup_members...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table user_user...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table user_user_groups...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table user_user_user_permissions...
-- Sending SELECT query...
-- Retrieving rows...
-- Disconnecting from localhost...
???mysql_backup_restore ll
total 67624
-rw-r--r--??1 crifan??staff????33M??7 25 10:07 local_mysql_naturling.sql
???mysql_backup_restore mv local_mysql_naturling.sql local_mysql_naturling_180725.sql
???mysql_backup_restore ll
total 67624
-rw-r--r--??1 crifan??staff????33M??7 25 10:07 local_mysql_naturling_180725.sql
???mysql_backup_restore mysqladmin -uroot -pcrifan_mysql create naturling_local
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
???mysql_backup_restore mysql -uroot -pcrifan_mysql naturling_local < local_mysql_naturling_180725.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
即可。
總結
以上是生活随笔為你收集整理的mysql 数据库名字 mac,【已解决】Mac本地给mysql数据库改名的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Win10正式版怎么一键激活 Win10
- 下一篇: linux mysql 停止,linux