/

Configure MySQL Database


  1. SSH into the MySQL Instance that you created
  2. Install NTP and unzip: apt-get install unzip ntp
  3. Install MySQL: apt-get install mysql-server - during the MySQL installation, you will be prompted to set the root password - make a note of what you set this to.
  4. IMPORTANT: Modify /etc/mysql/mysql.conf.d/mysqld.cnf commenting out the line: bind-address = 127.0.0.1 by pre-pending with a #; Also, uncomment the max_connections line and set that to 100000 (max_connections = 100000). (NOTE: for a development environment, you may want to run Stream Manager, Terraform and MySQL all on the same droplet. In this case, you would leave the default bind-address setting)
  5. Restart MySQL service systemctl restart mysql to apply the above settings
  6. Add non-root user:
  7. Connect to database as root mysql -u root -p (enter root password).
  8. Create new user: at mysql> prompt: CREATE USER 'mynewuser'@'%' IDENTIFIED BY 'goodPassword'; where mynewuser is your dbadmin and goodPassword is your secure password.
  9. If you are successful, you will see Query OK, 0 rows affected (0.00 sec)
  10. Apply privileges to the new user: GRANT ALL PRIVILEGES ON * . * TO 'mynewuser'@'%';
  11. Reload the privileges to make sure the new ones are in place: FLUSH PRIVILEGES;
  12. Create cluster database:
  13. Connect with the new user: type quit to logout root user, then mysql -u mynewuser -p
  14. Create database: CREATE DATABASE cluster;
  15. Add Cluster schema (Note as of server version 9.0.0, the database is automatically populated when the Stream Manager starts up):
  16. Download the Red5 Pro Server Distribution, and unzip on your server.
  17. Navigate to {red5prohome}/webapps/streammanager/WEB-INF/sql/ to find the cluster.sql file.
  18. Run the sql script: mysql -u mynewuser -p cluster < cluster.sql (you will be prompted to enter the password that you set above).