Configure SSL for MySQL

Source: Internet
Author: User
Tags localhost mysql

[Client]
SSL-CA = $ DIR/cacert. pem
SSL-Cert = $ DIR/client-cert.pem
SSL-Key = $ DIR/client-key.pem
[Mysqld]
SSL-CA = $ DIR/cacert. pem
SSL-Cert = $ DIR/server-cert.pem
SSL-Key = $ DIR/server-key.pem

 

 

 

6. Test MySQL startup
$ DIR is the path of the Option file my. CNF
Shell> mysqld -- defaults-file = $ DIR/My. CNF &
Then invoke a client program using the same option file:
Shell> MySQL -- defaults-file = $ DIR/My. CNF

 

[Root @ localhost mysql-5.0.20a] # chown-r root/usr/local/MySQL
[Root @ localhost mysql-5.0.20a] # chown-r MySQL/usr/local/MySQL/var
[Root @ localhost mysql-5.0.20a] # chgrp-r MySQL/usr/local/MySQL
[Root @ localhost mysql-5.0.20a] #/usr/local/MySQL/bin/mysqld_safe -- user = MySQL &
[Root @ localhost MySQL] #./bin/MySQL-u root -- socket =/tmp/MySQL. Sock
For a service, you only need to put MySQL/share/MySQL. Server under/etc/init. d/and change it to MySQL.
[Root @ localhost MySQL] # chmod 775/etc/init. d/MySQL
[Root @ localhost MySQL] # chkconfig -- add MySQL

Mysql> grant all privileges on mydb. * To 'admin' @ '% 'identified by '123 ';

Grant all privileges on mydb2. * To 'd _ admin' @ '% 'identified by '123 ';

Grant all privileges on mydb2. * To 'bodd' @ '192. 168.18.14 'identified by 'domainssl' require SSL;
Flush privileges;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.