Configure MySQL Database
- SSH into the MySQL Instance that you created
- Install NTP and unzip:
apt-get install unzip ntp - 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. - IMPORTANT: Modify
/etc/mysql/mysql.conf.d/mysqld.cnfcommenting out the line:bind-address = 127.0.0.1by pre-pending with a#; Also, uncomment themax_connectionsline and set that to100000(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 defaultbind-addresssetting) - Restart MySQL service
systemctl restart mysqlto apply the above settings - Add non-root user:
- Connect to database as root
mysql -u root -p(enter root password). - Create new user: at
mysql>prompt:CREATE USER 'mynewuser'@'%' IDENTIFIED BY 'goodPassword';wheremynewuseris your dbadmin andgoodPasswordis your secure password. - If you are successful, you will see
Query OK, 0 rows affected (0.00 sec) - Apply privileges to the new user:
GRANT ALL PRIVILEGES ON * . * TO 'mynewuser'@'%'; - Reload the privileges to make sure the new ones are in place:
FLUSH PRIVILEGES;
- Connect to database as root
- Create
clusterdatabase:- Connect with the new user: type
quitto logout root user, thenmysql -u mynewuser -p - Create database:
CREATE DATABASE cluster;
- Connect with the new user: type
- Add Cluster schema (Note as of server version 9.0.0, the database is automatically populated when the Stream Manager starts up):
- Download the Red5 Pro Server Distribution, and unzip on your server.
- Navigate to
{red5prohome}/webapps/streammanager/WEB-INF/sql/to find thecluster.sqlfile. - Run the sql script:
mysql -u mynewuser -p cluster < cluster.sql(you will be prompted to enter the password that you set above).