?????????????MySQL????????????Щ???????5.6?ж?????????Щ???
???????? MySQL ????????????????Щ??
????MySQL?????????????????????
???????????????MySQL???????????????????????MySQL???????????????????????????????mysql.user???С????μ???????£?
????mysql [localhost] {msandbox} (mysql) > select user??password from mysql.user;
????+----------------+-------------------------------------------+
????| user           | password                                  |
????+----------------+-------------------------------------------+
????| root           | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| plain_password | *861D75A7F79DE84B116074893BBBA7C4F19C14FA |
????| msandbox       | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| msandbox       | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| msandbox_rw    | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| msandbox_rw    | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| msandbox_ro    | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| msandbox_ro    | *6C387FC3893DBA1E3BA155E74754DA6682D04747 |
????| rsandbox       | *B07EB15A2E7BD9620DAE47B194D5B9DBA14377AD |
????+----------------+-------------------------------------------+
????9 rows in set (0.01 sec)*
???????MySQL???????????????????????????????????????????????????????????????????????????????????????????????????????????й??????????????????????????????????????
????MySQL??????????????????????????????
????MySQL????????????????SHA1???????unhex??????????????????????????????????ù???????password_str = concat(‘*’?? sha1(unhex(sha1(password))))
??????????????????????????????????
????mysql [localhost] {msandbox} (mysql) > select password('mypassword')??concat('*'??sha1(unhex(sha1('mypassword'))));
????+-------------------------------------------+---------------------------------------------+
????| password('mypassword')                    | concat('*'??sha1(unhex(sha1('mypassword')))) |
????+-------------------------------------------+---------------------------------------------+
????| *FABE5482D5AADF36D028AC443D117BE1180B9725 | *fabe5482d5aadf36d028ac443d117be1180b9725   |
????+-------------------------------------------+---------------------------------------------+
????1 row in set (0.01 sec)
????MySQL??????????????
???????MySQL??5.6?汾????????????????????????????????????????????????磬MySQL????binary log?к???????????????????????????????MySQL??????????create user??grant user … identified by??????Я????????????????????????binary log???????????????????????????????????????????
????????????????
????mysql [localhost] {msandbox} (mysql) > create user plain_password identified by 'plain_pass';
????Query OK?? 0 rows affected (0.00 sec)
??????mysqlbinlog?????????????
????shell> mysqlbinlog binlog.000001
????# at 106
????#150227 23:37:59 server id 1  end_log_pos 223   Query   thread_id=1 exec_time=0 error_code=0
????use mysql/*!*/;
????SET TIMESTAMP=1425051479/*!*/;
????SET @@session.pseudo_thread_id=1/*!*/;
????SET @@session.foreign_key_checks=1?? @@session.sql_auto_is_null=1?? @@session.unique_checks=1?? @@session.autocommit=1/*!*/;
????SET @@session.sql_mode=0/*!*/;
????SET @@session.auto_increment_increment=1?? @@session.auto_increment_offset=1/*!*/;
????/*!/C latin1 *//*!*/;
????SET @@session.character_set_client=8??@@session.collation_connection=8??@@session.collation_server=8/*!*/;
????SET @@session.lc_time_names=0/*!*/;
????SET @@session.collation_database=DEFAULT/*!*/;
????create user plain_password identified by 'plain_pass'
????/*!*/;
????DELIMITER ;
????# End of log file
????ROLLBACK /* added by mysqlbinlog */;
????/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
????MySQL5.6?ж?????????????????
????????MySQL5.6?????????????????????????????????????????binlog?е??????MySQL?????????л???????????????????????????
????CREATE USER … IDENTIFIED BY …
????GRANT … IDENTIFIED BY …
????SET PASSWORD …
????SLAVE START … PASSWORD = … (as of 5.6.4)
????CREATE SERVER … OPTIONS(… PASSWORD …) (as of 5.6.9)
????ALTER SERVER … OPTIONS(… PASSWORD …) (as of 5.6.9)
?????????????????change master to master_password=”??????????????С??????ζ??MySQL5.6?????????????????????replication??а????????????????5.6?????????????????change master to?????warning????????????£?
????slave1 [localhost] {msandbox} ((none)) > change master to master_host='127.0.0.1'??master_port =21288??master_user='rsandbox'??master_password='rsandbox'??master_auto_position=1;
????Query OK?? 0 rows affected?? 2 warnings (0.04 sec)
????slave1 [localhost] {msandbox} ((none)) > show warnings;
????+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
????| Level | Code | Message                                                                                                                                                                                                                                                                              |
????+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
????| Note  | 1759 | Sending passwords in plain text without SSL/TLS is extremely insecure.                                                                                                                                                                                                               |
????| Note  | 1760 | Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
????+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
????2 rows in set (0.00 sec)