MySQL
MySQL#
Set up MySQL#
- change bind to 0.0.0.0sudo systemctl restart mysql
sudo ufw allow from remote_ip_address to any port 3306
sudo mysql -u root
CREATE USER 'username'@'host' IDENTIFIED BY authentication_plugin BY 'password';
GRANT PRIVILEGE ON database.table TO 'username'@'host';
FLUSH PRIVILEGES;
sudo systemctl restart mysql
MySQL in Linux#
- After log in
-
Show content of a table
SELECT * FROM Wordpress.wp_options; -
Select Database
USE Wordpress;
-Update data of wordpress
UPDATE wp_options SET option_value = replace(option_value, 'https://web.com' , 'http://web.com');
-
Delete Database
DROP DATABASE <name> -
Show Database
Show tables;
Use MySQL Workbench#
-
Create user for that specific PC's User to use workbench on
CREATE USER 'username'@ip.of.that.pc' IDENTIFIED BY 'password'; -
Grant all privileges
GRANT ALL PRIVILEGES ON *.* TO 'username'@'ip.of.that.pc'; -
Flush Privilleges
FLUSH PRIVILEGES; -
Exit and Restart MySQL
sudo systemctl restart mysql