mysql導入、導出 ( 帶視圖)


1創建賬號授權

grant all privileges on jenkinsddbes.* to 'jenkinsddbes'@'%' identified by '1iN@Da12tA&*ba33gf8';


2、導出

mysqldump -u root -p jenkinsddbes > 2018-06-07.jenkinsddbes.sql

 


3、導入

[root@host-10-1-1-163 ~]# mysql -h 10.1.1.174 -u root -pzihoa@5tgb
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2593
Server version: 5.6.39-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database jenkinsddbes;
[root@host-10-1-1-204 ~]# mysql -u root -p jenkinsddbes < jenkinsddbes.sql

注意:導入數據庫默然是把視圖也給到進來了,

 

4、給視圖授權


grant create view on jenkins.* to 'jenkinsddbes'@'%';
grant show view on jenkins.* to jenkinsddbes@'%';

GRANT ALL PRIVILEGES ON 用戶名.* TO 數據庫名@'%' IDENTIFIED BY '數據庫密碼';

flush privileges;

 

5、更改視圖的所有者

進入navicat-設計視圖-高級-定義者:修改成jenkinsddbes@%

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM