This setup was performed on
Ubuntu 20.04.6 LTS x86_64
sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service
- Yes for all the options for best security
sudo mysql_secure_installation
- You should be able to login with the root user
sudo mysql
- You may change the username
cdfuser
- You may change the password
cdfpasswd
CREATE USER 'cdfuser'@'%' IDENTIFIED WITH BY 'cdfpasswd';
- Replication permissions is required to read the binlogs
- Some installation may turn off binlogs verify with
SHOW MASTER STATUS
- Not required for ubuntu installation
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'cdfuser'@'%';
GRANT RELOAD ON *.* TO 'cdfuser'@'%';
- You may change the database name
cdftest
CREATE DATABASE cdftest;
GRANT ALL PRIVILEGES ON cdftest.* TO 'cdfuser'@'%';
- After granting the privileges, it's a good practice to flush the privileges to ensure that the changes take effect immediately
FLUSH PRIVILEGES;
mysql -u cdfuser -p
Note: By default the server only binds to 127.0.0.1 If you wish to expose it to public you will have to update the
bind-address
to0.0.0.0