innodb插件方式安装myql 5.1

yum install gcc gcc-c++

groupadd mysql
useradd –shell /sbin/nologin -g mysql mysql
tar zxvf mysql-5.1.58.tar.gz
cd mysql-5.1.58

 

#设置一下 CFLAGS 和 CXXFLAGS,尤其要注意打开 HAVE_DLOPEN 选项
CFLAGS=’-O2 -DHAVE_DLOPEN -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic’

CXXFLAGS=’-O2 -DHAVE_DLOPEN -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic’

./configure –prefix=/data1/app/services/mysql
–with-charset=utf8
–with-collation=utf8_general_ci
–with-extra-charsets=complex
–enable-thread-safe-client
–enable-local-infile
–enable-assembler
–with-big-tables
–localstatedir=/data1/app/services/mysql/data
–with-unix-socket-path=/data1/app/tmp/mysql.sock
–with-mysqld-user=mysql
–with-plugins=max-no-ndb

make
make install

cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
chmod u+x /etc/init.d/mysql

cd /data1/app/services/mysql
bin/mysql_install_db –user=mysql –force –datadir=data
chown -R root  .
chown -R mysql data
chgrp -R mysql .

chkconfig –add mysql
chkconfig –level 345 mysql on
bin/mysqld_safe –user=mysql &
service mysql restart

 

ln -s /data1/app/mysql52/bin/mysql /sbin/mysql
ln -s /data1/app/mysql52/mysqladmin /sbin/mysqladmin

 

my.cnf文件参考(注意红色部分):

[mysqld]
datadir=/data1/app/services/mysql/data
socket=/data1/app/tmp/mysql.sock
pid-file=/data1/app/tmp/mysql.pid
user=mysql
port=3308

ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so

# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).

old_passwords=1

character-set-server = utf8
collation-server = utf8_general_ci
default-storage-engine=INNODB

skip-name-resolve
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 32512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 8M
thread_cache_size = 32
query_cache_size = 8M
tmp_table_size = 64M

# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 16
lower_case_table_names = 1
max_connections = 100

slow_query_log_file = /data1/app/log/mysql-slow.log
slow_query_log = 1
log-queries-not-using-indexes
long_query_time = 1
wait_timeout = 86400

log-bin = mysql-bin
server-id = 1
expire-logs-days = 7

innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 16M
innodb_file_per_table
innodb_open_files = 65535
innodb_lock_wait_timeout = 50
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 2

binlog_format = mixed
transaction-isolation = READ-UNCOMMITTED

[mysqld_safe]
log-error=/data1/app/log/mysql.log

 

启动数据库进去看下:

[root@fbtw-topcity log]# mysql -h 127.0.0.1 -P 3308
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.1.58-log Source distribution

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> show plugin;         
+————+———-+—————-+———————+———+
| Name       | Status   | Type           | Library             | License |
+————+———-+—————-+———————+———+
| binlog     | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| partition  | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| ARCHIVE    | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| BLACKHOLE  | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| CSV        | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| FEDERATED  | DISABLED | STORAGE ENGINE | NULL                | GPL     |
| MEMORY     | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| MyISAM     | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| MRG_MYISAM | ACTIVE   | STORAGE ENGINE | NULL                | GPL     |
| InnoDB     | ACTIVE   | STORAGE ENGINE | ha_innodb_plugin.so | GPL     |
+————+———-+—————-+———————+———+
10 rows in set, 1 warning (0.00 sec)

mysql> show variables like ‘innodb_%’;
+———————————+————————+
| Variable_name                   | Value                  |
+———————————+————————+
| innodb_adaptive_flushing        | ON                     |
| innodb_adaptive_hash_index      | ON                     |
| innodb_additional_mem_pool_size | 16777216               |
| innodb_autoextend_increment     | 8                      |
| innodb_autoinc_lock_mode        | 1                      |
| innodb_buffer_pool_size         | 268435456              |
| innodb_change_buffering         | inserts                |
| innodb_checksums                | ON                     |
| innodb_commit_concurrency       | 0                      |
| innodb_concurrency_tickets      | 500                    |
| innodb_data_file_path           | ibdata1:10M:autoextend |
| innodb_data_home_dir            |                        |
| innodb_doublewrite              | ON                     |
| innodb_fast_shutdown            | 1                      |
| innodb_file_format              | Antelope               |
| innodb_file_format_check        | Antelope               |
| innodb_file_per_table           | ON                     |
| innodb_flush_log_at_trx_commit  | 2                      |
| innodb_flush_method             | O_DIRECT               |
| innodb_force_recovery           | 0                      |
| innodb_io_capacity              | 200                    |
| innodb_lock_wait_timeout        | 50                     |
| innodb_locks_unsafe_for_binlog  | OFF                    |
| innodb_log_buffer_size          | 16777216               |
| innodb_log_file_size            | 536870912              |
| innodb_log_files_in_group       | 2                      |
| innodb_log_group_home_dir       | ./                     |
| innodb_max_dirty_pages_pct      | 75                     |
| innodb_max_purge_lag            | 0                      |
| innodb_mirrored_log_groups      | 1                      |
| innodb_old_blocks_pct           | 37                     |
| innodb_old_blocks_time          | 0                      |
| innodb_open_files               | 65535                  |
| innodb_read_ahead_threshold     | 56                     |
| innodb_read_io_threads          | 4                      |
| innodb_replication_delay        | 0                      |
| innodb_rollback_on_timeout      | OFF                    |
| innodb_spin_wait_delay          | 6                      |
| innodb_stats_method             | nulls_equal            |
| innodb_stats_on_metadata        | ON                     |
| innodb_stats_sample_pages       | 8                      |
| innodb_strict_mode              | OFF                    |
| innodb_support_xa               | ON                     |
| innodb_sync_spin_loops          | 30                     |
| innodb_table_locks              | ON                     |
| innodb_thread_concurrency       | 0                      |
| innodb_thread_sleep_delay       | 10000                  |
| innodb_use_sys_malloc           | ON                     |
| innodb_version                  | 1.0.17                 |
| innodb_write_io_threads         | 4                      |
+———————————+————————+
50 rows in set (0.02 sec)

mysql>

openvpn 加路由失败的问题

openvpn在win7或windows 2003有时会有下面的问题:

Thu Apr 07 23:13:51 2011 Notified TAP-Win32 driver to set aDHCP IP/netmask of 192.168.0.4/255.255.255.0 on interface{8FE77B49-DAF1-492B-881F-B15C991EF754} [DHCP-serv: 192.168.0.0,lease-time: 31536000]

Thu Apr 07 23:13:51 2011 NOTE: FlushIpNetTable failed oninterface [15] {8FE77B49-DAF1-492B-881F-B15C991EF754} (status=5) :拒绝访问。  Thu Apr 07 23:13:52 2011 TEST ROUTES: 1/1 succeeded len=1ret=1 a=0 u/d=upThu Apr 07 23:13:52 2011 route ADD 192.168.1.0 MASK255.255.255.0 192.168.0.1Thu Apr 07 23:30:54 2011ROUTE: route addition failed usingCreateIpForwardEntry: 至少有一个参数不正确。  [if_index=15]Thu Apr 07 23:30:54 2011 Route addition via IPAPI failedThu Apr 07 23:30:54 2011 Initialization SequenceCompleted

 

关于

NOTE: FlushIpNetTable failed oninterface [15] {8FE77B49-DAF1-492B-881F-B15C991EF754} (status=5) :拒绝访问。 

的问题,一般在windows 2003上出现比较多,可能是启动了windows 2003的路由及远程访问服务,停止这个服务后应该可以解决。

 

关于

ROUTE: route addition failed usingCreateIpForwardEntry: 至少有一个参数不正确。

的问题,可以在配置文件内加下面三个参数解决:

script-security 3
route-method exe
route-delay 2

 

另外win7的系统需注意要用管理员权限运行openvpn,否则会因没有权限加路由而失败。