find and replace SQL

UPDATE `tablename` SET `fieldname` = replace(`fieldname`, ‘UNWANTED-TEXT’, ‘WANTED-TEXT’)

Set-up MacMini 1.4Ghz Intel Core i5 4GB (OS X El Capitan 10.11.2)

$ sudo easy_install pip $ sudo pip install -U setuptools already installed on El Cap $ sudo pip install pyserial install MariaDB as that is what is installed on pew == make sure Xcode is uptodate or install it   (this triggered an OS install, do it) $ xcode-select –install install homebrew $ ruby -e… Continue reading Set-up MacMini 1.4Ghz Intel Core i5 4GB (OS X El Capitan 10.11.2)

Raspberry Pi 3B setup

install NOOBS from https://www.raspberrypi.org/downloads/noobs/ v 1.8.0 released 2016-02-29 Get online using wifi dongle and QMUL Guest login (fuck eduroam for now) >sudo apt-get update >sudo apt-get install mysql-server >sudo apt-get upgrade >sudo pip install PyMySQL Changed mind and went for MariaDB as that is what I use on PEW >sudo apt-get install mariadb-server As MySQL… Continue reading Raspberry Pi 3B setup

Local iMac db setup

status at 20151117: Python script ok. Failing at the MySQL commit as the primary key stuff is not letting the data into the table. To do: add data to the sensor table. check PKs and FKs. check them again. Look at using python to check for duplicates instead of doing it this way.

Setting up iMac (OSXYosemite 10.10.5)

$ sudo easy_install pip $ sudo pip install -U setuptools $ sudo pip install pyserial install MariaDB as that is what is installed on pew == make sure Xcode is uptodate or install it $ xcode-select –install install homebrew $ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Check Homebrew $ brew doctor Update Homebrew $ brew update… Continue reading Setting up iMac (OSXYosemite 10.10.5)

MySQL TIPS

for pew: sudo mysql (to give permissions) create database ; (only needs setting up once) use ; (before you start working on a db, make sure you are using the right one) create table …etc see below. show tables; describe ; DB: nmr TABLE: datatest CREATE TABLE datatest (time TIMESTAMP, recID TINYINT(10), avidID VARCHAR(16)); Check… Continue reading MySQL TIPS