MySQL
Installation
- Run the following commands to install MySQL on Ubuntu server and to check its status:
sh
sudo apt install -y mysql-server
sudo systemctl status mysqlConfiguration
- Secure the MySQL installation by running the following command:
sh
sudo mysql_secure_installation
# set VALIDATE PASSWORD COMPONENT to y
# Password validation policy -> 2 (STRONG)
# Remove anonymous users? -> y
# Disallow root login remotely? -> y
# Remove test database and access to it? -> y
# Reload privilege tables now? -> y- Log into MySQL service as root user using
sudo mysqlcommand. - Create and set password for piratedev user:
sql
-- Create piratedev user
CREATE USER piratedev IDENTIFIED BY '<password>';
-- Password found in iCloud keychain- Create database with same name and set owner:
sql
CREATE DATABASE piratedev;
GRANT ALL PRIVILEGES ON piratedev.* TO piratedev;You should now be able to log into MySQL service as new user using
mysql -u piratedev -pcommand.Update
mysqld.cnffile:
sh
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
# Set user to piratedev
# Set bind-address to 192.168.1.100- Restart MySQL server to take effect:
sh
sudo systemctl restart mysqlTest Connection
- Test your connection from any SQL client on another machine within the LAN network.
- Use host IP as
192.168.1.100and DB user aspiratedev. - [DBeaver] Change
allowPublicKeyRetrievaltoTRUEin SQL Client's driver properties.
- Use host IP as
