mysql导入导出 ( 带视图)
Posted effortsing
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql导入导出 ( 带视图)相关的知识,希望对你有一定的参考价值。
1创建账号授权
grant all privileges on jenkinsddbes.* to ‘jenkinsddbes‘@‘%‘ identified by ‘[email protected]&*ba33gf8‘;
2、导出
mysqldump -u root -p jenkinsddbes > 2018-06-07.jenkinsddbes.sql
3、导入
[[email protected] ~]# mysql -h 10.1.1.174 -u root [email protected]
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;
[[email protected] ~]# mysql -u root -p jenkinsddbes < jenkinsddbes.sql
注意:导入数据库默然是把视图也给到进来了,
4、给视图授权
grant create view on jenkins.* to ‘jenkinsddbes‘@‘%‘;
grant show view on jenkins.* to [email protected]‘%‘;
GRANT ALL PRIVILEGES ON 用户名.* TO 数据库名@‘%‘ IDENTIFIED BY ‘数据库密码‘;
flush privileges;
5、更改视图的所有者
进入navicat-设计视图-高级-定义者:修改成[email protected]%
以上是关于mysql导入导出 ( 带视图)的主要内容,如果未能解决你的问题,请参考以下文章