Heisenberg - Digital Alchemist, Software Architect, Automation Specialist and Mechanical Engineer.
Labels
Tuesday, 24 March 2020
Server Settings for Dreamweaver
In my example, my web server is on my local network, accessible from the internet, so to prevent setting up firewall rules and port forwarding to allow external access to FTP etc, I would rather connect using the local private IP address.
However, previously when attempting this, the default directory was the home directory for the user used which is no good.
The screen shot below, shows how to properly accomplish this;
Saturday, 7 March 2020
MySQL triggers
The first one was to evaluate a condition on inserting a new record, while the second one was to evaluate the same condition but this time on update.
Sunday, 1 March 2020
Backup and restore MySQL database
To backup a MySQL database
See this link here
shell> mysqldump [arguments] > file_name
shell> mysqldump --all-databases > dump.sql
shell> mysqldump --triggers --routines --all-databases > dump.sql
shell> mysqldump --databases db1 db2 db3 > dump.sql
shell> mysqldump --databases dbname > dump.sql
OR omit the --databases
shell> mysqldump test > dump.sql
To dump only specific tables from a database use;
shell> mysqldump dbmane table1 table3 table7 > dump.sql
To dump only the structure from a database use;
shell> mysqldump --no-data dbmane > dump.sql
shell> mysqldump --d dbmane > dump.sql
Note: -d includes the triggers.
To dump only the routines from a all databases use;
mysqldump -u username -p -n -t -d -R --all-databases > routines.sql
To add the host 192.168.254.198 and the user root, do;
shell> mysqldump --host=192.168.254.198 --port=3307 -u root -p dbmane > dump.sql
See also my post here for details on how to simply copy the table structure.
mysqldump --host=[...] -udev -p --no-data --triggers --routines my_db > my_db_structure.sql
To restore a MySQL database
To login to mysql, do;
mysql -u username -p