The ntpdate utility is deprecated (though still available via apt get install in Debian Jessie). To sync local clock without ntpdate:
sudo systemctl stop ntp
sudo ntpd -gq
sudo systemctl start ntp
The list of time servers to use is usually in /etc/ntp.conf (for the Beaglebone Jessie console image and Ubuntu server 16.04.2 LTS).
- - - - -
UHCM-specific:
NTP using public time servers doesn't work when using the UHM/SOEST network. Add server ntp.soest.hawaii.edu to /etc/ntp.conf to fix this.
Wednesday, April 19, 2017
Wednesday, March 15, 2017
MySQL Cheatsheet
Under Ubuntu Server 16.04:
To login to MySQL from terminal as root:
mysql -u root -pOnce inside the MySQL prompt:
To view the list of databases:
SHOW SCHEMAS;To use a particular database:
USE databasename;To view the list of tables inside the database:
SHOW TABLES;To create a new user:
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';To enable remote access to the MySQL database (for example, using MySQL Workbench):
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;(optional) To grant only specific rights instead of all (using SELECT as example):
GRANT SELECT ON *.* TO 'username'@'localhost';Back to terminal, comment out the "bind_address" line in the MySQL config file. It's in /etc/mysql/mysql.conf.d/mysqld.cnf on my Ubuntu server 16.04.
Finally, restart the MySQL process:
sudo service mysql restart- - - - -
Recently migrated from SQLite to MySQL. You can't beat SQLite's simplicity, but it's not so good for simultaneous access (single writer, multiple readers). Try to rsync the db to another machine while it's open and it quickly gets out of sync. On top of that there are the Linux permission issues (read-only users need write access to the db and its containing folder because SQLite needs to write temporary journal files).
Subscribe to:
Posts (Atom)