Thursday, April 7, 2011

TrendingTopics MySQL database

I'm starting to dissect the TrendingTopics shell and sql scripts, but got a bit confused with the tables available to me. So I installed and used MySQL Workbench to show the database schema. There are 11 tables in trendingtopics_development, but no referential integrity is enforced:
daily_timelines
daily_trends
pages
weekly_trends
schema_migrations
new_daily_timelines
new_pages
new_daily_trends
companies
people
featured_pages


Here is the table layout of the development database:


Only five tables are populated with data. The top four have 100 records of test data and are the core tables that drive the application. The last table called "schema_migrations" is an audit table and has no data intended for the web application:
daily_timelines
daily_trends
pages
weekly_trends
schema_migrations


Here's a sample of the contents of the four core tables:


MySQL Workbench install hiccup
Starting MySQL on bootup error, need to edit /etc/init.d/mysql for startup levels
linux-z6tw:/etc/init.d # chkconfig --level 235 mysql on
insserv: FATAL: service network is missed in the runlevels 2 to use service mysql
insserv: exiting now!
/sbin/insserv failed, exit code 1

After editing /etc/init.d/mysql # Default-Start: 3 5
linux-z6tw:/etc/init.d # chkconfig --level 35 mysql on
linux-z6tw:/etc/init.d # /etc/init.d/mysql start
Starting service MySQL done
linux-z6tw:/etc/init.d # netstat -an | grep LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

MySQL Reference
MySQL passwordless login
Copying tables
Insert Into example
Delete syntax
Total number of locks exceed the lock table size
Option files
Inno DB Transaction Model
Various Advice on Enabling Explicit Commits

No comments:

Post a Comment