Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Sunday, 4 November 2012

mysql, python, peewee

I want to use python to work with my mysql database

install the python bindings

$ sudo yum install MySQL-python

download and install peewee - an object-relational mapping utility to python

$ wget https://github.com/coleifer/peewee/archive/master.tar.gz
$ gunzip peewee-master.tar.gz
$ tar -xvf peewee-master.tar
$ cd peewee-master/
$ sudo python setup.py install
$ sudo python setup.py test


Saturday, 3 November 2012

mysql


Install the the client and server software

$ sudo yum install mysql
$ sudo yum install mysql-server

start mysql server

$ sudo service mysqld start

automatically start mysql daemon on startup

$ sudo chkconfig --level 2345 mysqld on

set root password

$ mysqladmin -u root password foobar

login to localhost server

$ mysql -u root -p
mysql>

create a new user

mysql> create user 'username'@'localhost' identified by 'password';
mysql> grant all privileges on *.* to 'username'@'localhost' with grant option;

mysql-workbench: admin GUI

$ sudo yum install mysql-workbench

Tutorial on creating a database using mysql-workbench here