Eric @ EricBess WebHome

Wins do not arrogant, not to lose hungry, there is shock chest and face, such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

Wordpress database and that wpdb Class

To collate the following information network of non-original

The following are wp-2.0.5 version of the database structure of (ER diagram). Here only lists the primary key and foreign key. Diamond-shaped figure that 1: n relationship, as part of a white, black as part of the n.

wordpress-db-er-diagram.png

Wordpress A total of 10 tables, divided into four categories according to function.

  • user: user information, including wp_users table and wp_usermeta table.
  • post: The article reviews and information, including wp_posts, wp_postmeta, wp_comments, wp_post2cat, as well as five wp_categories table.
  • link: links, including wp_links table and wp_linkcategories table.
  • option: setting the overall situation, including wp_options table.

Table of naming is very interesting. Sum up the basic rules are as follows:

  • To preserve the basic properties of the object, named wp_objects, the use of the plural (for example, wp_posts, wp_comments);
  • Save the expansion of the object attributes, named wp_objectmeta, the use of the singular (for example, wp_postmeta, wp_usermeta);
  • Many-to-many relationship, named wp_a2b, which were b and a many-to-many relationship between the two ends of the object's name abbreviation (for example, wp_post2cat).
WPDB category

http://codex.wordpress.org.cn/Function_Reference/wpdb_Class

http://codex.wordpress.org/Function_Reference/wpdb_Class

Database description

http://codex.wordpress.org/Database_Description # Table_Overview

wp_categories: for the preservation of classified information related to the table. 5, including the field are:

  • cat_ID - each unique ID number classifications for a bigint (20) value, and with additional properties auto_increment.
  • cat_name - a classification name for a varchar (55) value.
  • category_nicename - the classification assigned to a user-friendly names to remember, that is, the so-called slug, this is a varchar (200) value.
  • category_description - a detailed description of the classification, longtext-value.
  • category_parent - the higher the classification categories, as a int (4) value, corresponding to the current table is the cat_ID, that is, wp_categories.cat_ID. No higher level classification, the value is 0.

Click to continue reading

March 12th, 2008 Posted by eric | Database, Wordpress Programming | no comments

MySQL 5 and the installation of new features

MySQL AB's MySQL 5.0 release that the company set up 10 years of the most significant product upgrade.

MySQL 5.0 new features include:
SQL stored procedures and functions - embedded business logic to the database and to improve performance;
Trigger - the database layer in the implementation of complex business rules;
View - to ensure the security of sensitive information;
Cursor - it easier for database development and large data sets of reference;
Information model - on the meta-data to facilitate the visit;
XA Distributed Transaction - to support the heterogeneous environments across multiple databases of the complex affairs;
SQL mode - to enforce the server checks the integrity of the data;
The new Archive and Federated storage engines - MySQL unique pluggable storage engine architecture allows users to be based on demand, easily switch between the database engine to obtain more flexibility, more features and better performance;
The new tool for transplantation - a new graphical tool kit from Oracle, Microsoft SQL Server, Microsoft Access databases and other platforms entirely transplanted to the object and all the data in MySQL;
Examples Manager - new management assistant allows remote start / stop any of the MySQL server, as well as remote editing configuration files, error and query logs to see the long-range functions;
Upgrade the connector and visualization tools - provide high-performance version of MySQL's ODBC, Java and. NET database drivers, as well as the upgrade of the MySQL Query Browser and MySQL Manager.

MySQL Installation:

wget-P tar / http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.17.tar.gz/from/http://www.greatlinux.com/mysql/
tar zxvf tar/mysql-5.0.17.tar.gz
cd mysql-5.0.17
groupadd mysql
useradd-g mysql mysql
CFLAGS = "-O3" CXX = gcc CXXFLAGS = "-O3-felide-constructors-fno-exceptions-fno-rtti" \
. / configure - prefix = / usr / local / mysql \
- enable-assembler - with-mysqld-ldflags =- all-static - with-charset = gbk
make-j 10
make install
cp support-files/my-medium.cnf / etc / my.cnf

Click to continue reading

November 28th, 2007 Posted by eric | Database, System | no comments

phpMyAdmin install, configure, use (for linux and FreeBSD)

1. Installation

wget-P tar / http://easynews.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.7.0-pl2.tar.bz2
tar jxvf tar/phpMyAdmin-2.7.0-pl2.tar.bz2
mv phpMyAdmin-2.7.0-pl2 mysqladmin # (optional address)
cp-R mysqladmin / usr / local / apache / htdocs /

2. Configuration

vi / usr / local / apache / htdocs / mysqladmin / config.default.php
# Modify your space will be uploaded to the Web site of the phpMyAdmin
If #: $ cfg [ 'PmaAbsoluteUri'] = 'http://your.domain.com/phpmyadmin/';
$ cfg [ 'Servers'] [$ i] [' host '] =' localhost '; (usually by default, there are exceptions)
$ cfg [ 'Servers'] [$ i] [' auth_type '] =' config '; / / Authentication method (config, http or cookie based)?
In their own yard drive with debug config, if used on the Internet cookie.
$ cfg [ 'Servers'] [$ i] [' user '] =' root '; / / MySQL user (user name, the machines themselves, with root, in-line set up your ftp user name)
$ cfg [ 'Servers'] [$ i] [' password '] =''; / / MySQL password (only needed
Do not have to set up their own machine, $ cfg [ 'Servers'] [$ i] [' only_db '] =''; / / If set to a db-name, only (you have only one set of data on you) have set up $ cfg [ 'DefaultLang'] = 'zh';

3. Security

# Increase in user authentication http://www.ericbess.com/ericblog/2007/12/29/apache-linuxfreebsd-setup/
section 2

FreeBSD Ports install

cd / usr / ports / databases / phpmyadmin
echo "WITHOUT_X11 = YES">> / etc / make.conf
make install clean
cp / usr / local / www / phpMyAdmin / config.sample.inc.php / usr / local / www / phpMyAdmin / config.inc.php
ee / usr / local / www / phpMyAdmin / config.inc.php
$ cfg [ 'blowfish_secret'] = 'e2311'; / * YOU MUST FILL IN THIS FOR COOKIE AUTH! * /
edit httpd.conf
Alias / phpmyadmin / "/ usr / local / www / phpMyAdmin /"
<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Deny, Allow
Allow from all
</ Directory>

Click to continue reading

November 28th, 2007 Posted by eric | Database | no comments

MySQL common operation

1, showed that the database mysql> show databases;
2, show the table in the database mysql> use of tables;
mysql> show tables;
3, the data show that the structure of the table:
describe table;

4, table shows the record:
select * from table;
5, database:
create database of the Treasury;
6, Jian:
use of the Treasury;
create table of Table (a list of field settings);

For example: aaa just created in the library table to build name, in the form id (serial number, automatic increase), xm (name), xb (gender), csny (birth date) to four field use aaa;
mysql> create table name (id int (3) auto_increment not null primary key, xm char (8), xb char (2), csny date);

Click to continue reading

April 5th, 2007 Posted by eric | Database | no comments