MySQL

1 min read

Execute command remotely

mysql -u root -h 192.168.xx.xx -p \
  -e 'CREATE DATABASE IF NOT EXISTS test DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci'

mysql -u root -h 192.168.xx.xx -p \
  -e 'SHOW DATABASES'