Difference between revisions of "Mysql"
From Bashlinux
Line 23: | Line 23: | ||
</nowiki></pre> |
</nowiki></pre> |
||
− | # Test |
+ | # Test SSL on Mysql. Login into MySQL Server |
+ | |||
− | ## Login into MySQL Server |
||
− | |||
<pre><nowiki> |
<pre><nowiki> |
||
− | + | mysql -u root -p |
|
− | + | </nowiki></pre> |
|
# Check SSL Cipher |
# Check SSL Cipher |
||
+ | |||
− | |||
<pre><nowiki> |
<pre><nowiki> |
||
− | + | mysql> show status like 'Ssl_cipher'; |
|
− | + | +--------------+-------------------+ |
|
− | + | | Variable_name| Value | |
|
− | + | +--------------+-------------------+ |
|
− | + | | Ssl_cipher | DHE-RSA-AES256-SHA| |
|
− | + | +--------------+-------------------+ |
|
− | + | 1 row in set (0.01 sec) |
|
− | + | </nowiki></pre> |
|
# Done |
# Done |
||
== Master-Master Replication == |
== Master-Master Replication == |
||
+ | |||
+ | Ensure the following settings in both servers: |
||
+ | |||
+ | <pre><nowiki> |
||
+ | relay-log = /mnt/mysql-binlogs/mysql-relay-bin |
||
+ | auto-increment-increment=2 |
||
+ | binlog-format=MIXED |
||
+ | </nowiki></pre> |
||
+ | |||
+ | |||
+ | Primary server only: |
||
+ | |||
+ | <pre><nowiki> |
||
+ | auto-increment-offset=1 |
||
+ | server-id=1 |
||
+ | </nowiki></pre> |
||
+ | |||
+ | |||
+ | Secondary server only: |
||
+ | |||
+ | <pre><nowiki> |
||
+ | auto-increment-offset=2 |
||
+ | server-id=2 |
||
+ | </nowiki></pre> |
||
+ | |||
+ | |||
Good links: |
Good links: |
||
* [[http://www.howtoforge.com/mysql5_master_master_replication_debian_etch]] |
* [[http://www.howtoforge.com/mysql5_master_master_replication_debian_etch]] |
Revision as of 22:05, 16 December 2011
MySQL
MySQL server with SSL
- Create a certificate as described in OpenSSL section.
- Add the following under each directive on `/etc/my.cnf`, if the directive doesn't exists it should be created
[client] ssl-ca=/etc/pki/openssl/cacert.pem ssl-cert=/etc/pki/openssl/client-cert.pem ssl-key=/etc/pki/openssl/client-key.pem [mysqld] ssl-ca=/etc/pki/openssl/cacert.pem ssl-cert=/etc/pki/openssl/server-cert.pem ssl-key=/etc/pki/openssl/server-key.pem
- Restart the server
service mysqld restart
- Test SSL on Mysql. Login into MySQL Server
mysql -u root -p
- Check SSL Cipher
mysql> show status like 'Ssl_cipher'; +--------------+-------------------+ | Variable_name| Value | +--------------+-------------------+ | Ssl_cipher | DHE-RSA-AES256-SHA| +--------------+-------------------+ 1 row in set (0.01 sec)
- Done
Master-Master Replication
Ensure the following settings in both servers:
relay-log = /mnt/mysql-binlogs/mysql-relay-bin auto-increment-increment=2 binlog-format=MIXED
Primary server only:
auto-increment-offset=1 server-id=1
Secondary server only:
auto-increment-offset=2 server-id=2
Good links:
InnoDB
When work with this engine don't forget to do a "commit" after any INSERT/UPDATE execution.