Generating Certificates for MySQL Version: ‘5.5.40-0ubuntu0.14.04.1’

Generating SSL Certificates for MySQL Daemon using openssl. cd /etc/mysql # Generate a CA key and certificate with SHA1 digest openssl genrsa 2048 > ca-key.pem openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem # Create server key and certficate with SHA1 digest, sign it and convert # the RSA key from PKCS #8 (OpenSSL 1.0 and newer) to the old PKCS #1 format openssl req -sha1 -newkey rsa:2048 -days 730 -nodes -keyout server-key.pem > server-req.pem openssl x509 -sha1 -req -in server-req.pem -days 730 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem openssl rsa -in server-key.pem -out server-key.pem # Create client key and certificate with SHA digest, sign it and convert # the RSA key from PKCS #8 (OpenSSL 1.0 and newer) to the old PKCS #1 format openssl req -sha1 -newkey rsa:2048 -days 730 -nodes -keyout client-key.pem > client-req.pem openssl x509 -sha1 -req -in client-req.pem -days 730 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem openssl rsa -in client-key.pem -out client-key.pem # Ensure mysql user got the right access chown mysql:adm *.pem # Configure MySQL to use the certificates nano my.cnf add lines ssl=1 ssl-ca=/etc/mysql/ca-cert.pem ssl-cert=/etc/mysql/server-cert.pem ssl-key=/etc/mysql/server-key.pem service mysql restart [/code] tadaaa! hope this...

Error establishing a database connection on WordPress

Are you encountering database connection errors on your WordPress site? Your database status could be on “stop/waiting” Solution (using putty): First we’ll check the status of mysql sudo su - service mysql status If it shows the mysql status is “stop/waiting” we can proceed to restart it. service mysql restart Once it’s restarted, it should be up and...

Reset MySQL root password (ubuntu)

Oops! I’ve forgotten MySQL root password. 1)Stop MySQL instance (if it is running) sudo service mysql stop 2)Startup MySQL instance manually with option –skip-grant-tables and –skip-networking sudo mysqld_safe --skip-grant-tables --skip-networking 3)While MySQL is running from step 2, login to MySQL mysql --user=root mysql 4)Execute the following SQL commands to update root password Update user set Password=PASSWORD('new-password') where user='root'; flush privileges; exit; 5)Remember to stop MySQL instance executed from step 2 after you complete step 4. Lastly run MySQL normally. sudo service mysql...