mysql复制和GRANT没有完全授予

时间:2016-05-25 15:08:02

标签: mysql database-replication grant

我正在尝试设置mysql复制。一切顺利,但我看到奴隶的错误1045:

$ mysql -h my-host-name -u slave_user -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.5.49-0ubuntu0.14.04.1-log (Ubuntu)

Copyright (c) 2000, 2016, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)

mysql> use my_db_name;
ERROR 1044 (42000): Access denied for user 'slave_user'@'%.my-domain.com' to database 'my_db_name'
mysql>

我尝试手动连接,它开始很好,但我有一个权限问题:

CREATE USER 'slave_user'@'%.my-domain.com'
IDENTIFIED BY 'changeme';

GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%.my-domain.com';

但是在主人身上,我创建了奴隶用户,这似乎绰绰有余:

GRANT REPLICATION SLAVE ON my_db_name.* TO 'slave_user'@'%.my-domain.com';

(顺便说一下:我想我会更喜欢mysql> select * from mysql.user where user = 'slave_user'\G *************************** 1. row *************************** Host: %.my-domain.com User: slave_user Password: *la-de-da-da-nothing-to-see-here-hashed Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: N Grant_priv: N References_priv: N Index_priv: N Alter_priv: N Show_db_priv: N Super_priv: N Create_tmp_table_priv: N Lock_tables_priv: N Execute_priv: N Repl_slave_priv: Y Repl_client_priv: N Create_view_priv: N Show_view_priv: N Create_routine_priv: N Alter_routine_priv: N Create_user_priv: N Event_priv: N Trigger_priv: N Create_tablespace_priv: N ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 plugin: authentication_string: NULL 1 row in set (0.00 sec) mysql> ,但这是一个错误,我应该首先使用它。)

  <input type="text" id="dropTextnew">
      <input type="button" name="team-btn" id="team-btn" value="Search">  
      <ul id="addList"> 
      <li><input type="checkbox" /><span>MacLeod Conner</span></li>
      <li><input type="checkbox" /><span>Dolores Arnold</span></li>
      <li><input type="checkbox" /><span>Blake Francis</span></li>
      <li><input type="checkbox" /><span>Chavarin Deanna</span></li>
      <li><input type="checkbox" /><span>Robert</span></li>
      <li><input type="checkbox" /><span>Zimmerman</span></li>
      <li><input type="checkbox" /><span>Zimmerman</span></li>
      <li><input type="checkbox" /><span>Chavarin Conner</span></li> 
      </ul>  

有什么建议吗?

0 个答案:

没有答案