one js validation framework
http://niceue.com/validator/demo/twitter-js.php?theme=yellow_right_effect
posted @
2013-10-10 10:37 hellxoul 閱讀(359) |
評論 (0) |
編輯 收藏
Linux操作系統:CentOS 6.3
1:下載:當前mysql版本到了5.6.10
下載地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
選擇“Source Code”
在此之前最好注冊一個Oracle賬號
2:必要軟件包
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake
3:編譯安裝
[root@server182 ~]# groupadd mysql
[root@server182 ~]# useradd -r -g mysql mysql
[root@server182 ~]# tar -zxvf mysql-5.6.10.tar.gz
[root@server182 ~]# cd mysql-5.6.10
[root@server182 mysql-5.6.10]# cmake .
[root@server182 mysql-5.6.10]# make && make install
-------------------------默認情況下是安裝在/usr/local/mysql
[root@server182 ~]# chown -R mysql.mysql /usr/local/mysql
[root@server182 ~]# cd /usr/local/mysql/scripts
[root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@server182 ~]# cd /usr/local/mysql/support-files
[root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysql
[root@server182 support-files]# cp my-default.cnf /etc/my.cnf
[root@server182 ~]# chkconfig -add mysql
[root@server182 ~]# chkconfig mysql on
[root@server182 ~]# service mysql start
Starting MySQL SUCCESS!
[root@server182 support-files]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.10, for Linux (i686) using EditLine wrapper
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.10 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 5 min 45 sec
Threads: 1 Questions: 5 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 63 Queries per second avg: 0.014
-------------
mysql>
安裝完畢。
原文鏈接:http://www.linuxidc.com/Linux/2013-02/79791.htm
posted @
2013-05-17 15:20 hellxoul 閱讀(260) |
評論 (0) |
編輯 收藏
MySQL 5.6正式版發布了,相對于5.5版本作出了不少改進,其源碼安裝配置方式也有所變化,本文根據實際操作,不斷嘗試,精確還原了安裝的具體步驟。
環境:CentOS 6.3/6.4 最小化缺省安裝,配置好網卡。
安裝MySQL前,確認Internet連接正常,以便下載安裝文件。
先使用 yum -y update 指令升級系統到最新版本。
本安裝將MySQL的數據文件與執行文件分離,如果你打算設置到不同的路徑,注意修改對應的執行命令和數據庫初始化腳本。
# 修改防火墻設置,打開3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
# 重啟防火墻使新設置生效
service iptables restart
# 新增用戶組
groupadd mysql
# 新增用戶
useradd mysql -g mysql
# 新建數據庫執行文件目錄
mkdir -p /usr/local/mysql
# 新建數據庫數據文件目錄
mkdir -p /db/mysql/data
# 編輯PATH搜索路徑
vi /etc/profile
Append these 2 lines to the end of the file:
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
export PATH
# 生效PATH搜索路徑
source /etc/profile
# 編輯hosts文件,加入本機IP和主機名
vi /etc/hosts
192.168.211.100 centhost.centdomain
# 安裝編譯源碼所需的工具和庫
yum -y install wget gcc-c++ ncurses-devel cmake make perl
# 進入源碼壓縮包下載目錄
cd /usr/local/src
# 下載源碼壓縮包,下載包34M大小,有點慢,等吧。
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/
# 解壓縮源碼包
tar -zxvf mysql-5.6.10.tar.gz
# 進入解壓縮源碼目錄
cd mysql-5.6.10
# 從mysql5.5起,mysql源碼安裝開始使用cmake了,執行源碼編譯配置腳本。
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/db/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
# 編譯源碼,這一步時間會較長,耐心等待。
make
# 安裝
make install
# 清除安裝臨時文件
make clean
# 修改目錄擁有者
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /db/mysql/data
# 進入安裝路徑
cd /usr/local/mysql
# 執行初始化配置腳本,創建系統自帶的數據庫和表。
scripts/mysql_install_db --user=mysql --datadir=/db/mysql/data
初始化腳本在 /usr/local/mysql/my.cnf 生成了配置文件。需要更改該配置文件的所有者:
chown -R mysql:mysql /usr/local/mysql
多說兩句:在啟動MySQL服務時,會按照一定次序搜索my.cnf,先在/etc目錄下找,找不到則會搜索"$basedir/my.cnf",在本例中就是 /usr/local/mysql/my.cnf,這是新版MySQL的配置文件的默認位置!注意:在CentOS 6.4版操作系統的最小安裝完成后,在/etc目錄下會存在一個my.cnf,需要將此文件更名為其他的名字,如:/etc/my.cnf.bak,否則,該文件會干擾源碼安裝的MySQL的正確配置,造成無法啟動。
# 復制服務啟動腳本
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
# 啟動MySQL服務
service mysql start
# 設置開機自動啟動服務
chkconfig mysql on
# 修改MySQL用戶root的密碼
mysql -u root
mysql>use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
mysql>update user set Password = password('123456') where User='root';
mysql>flush privileges;
mysql>exit;
# 可選:運行安全設置腳本,修改MySQL用戶root(不是系統的root!)的密碼,禁止root遠程連接(防止破解密碼),移除test數據庫和匿名用戶,強烈建議生產服務器使用:
/usr/local/mysql/bin/mysql_secure_installation
后記:
2013年3月18日更新:
如果要使Windows平臺下的MySQL和Linux平臺下的MySQL協同工作,你需要設置Linux平臺下的全局變量lower_case_table_names=1,強制將數據表名稱轉換為小寫(大小寫不敏感)。參考我另一篇博文:http://www.cnblogs.com/jlzhou/archive/2013/03/18/2966106.html
>>>>> 版權沒有 >>>>> 歡迎轉載 >>>>> 原文地址 >>>>> http://www.cnblogs.com/jlzhou >>>>> 雄鷹在雞窩里長大,就會失去飛翔的本領,野狼在羊群里成長,也會愛上羊而喪失狼性。人生的奧妙就在于與人相處。生活的美好則在于送人玫瑰。和聰明的人在一起,你才會更加睿智。和優秀的人在一起,你才會出類拔萃。所以,你是誰并不重要,重要的是,你和誰在一起。
posted @
2013-05-17 15:18 hellxoul 閱讀(282) |
評論 (0) |
編輯 收藏
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--> 1 <project xmlns="http://maven.apache.org/POM/4.0.0 " &...
閱讀全文
posted @
2013-05-16 11:26 hellxoul 閱讀(14005) |
評論 (0) |
編輯 收藏
生成javadoc時,亂碼問題要注意兩個參數的設置
-encoding utf-8 -charset utf-8
前面的是文件編碼,后面的是生成的javadoc的編碼
例如用IntelliJ IDEA 6.0.1 生成javadoc時,在"Tools->Gerenate JavaDoc"面版的
"Other command line arguments:"欄里輸入"-encoding utf-8 -charset utf-8",
就是以utf-8編碼讀取文件和生成javadoc
posted @
2013-05-01 12:24 hellxoul 閱讀(505) |
評論 (0) |
編輯 收藏
CREATE TABLE `config_info` (
`id` BIGINT(64) UNSIGNED NOT NULL AUTO_INCREMENT,
`data_id` VARCHAR(255) NOT NULL DEFAULT '',
`group_id` VARCHAR(128) NOT NULL DEFAULT '',
`content` LONGTEXT NOT NULL,
`md5` VARCHAR(32) NOT NULL DEFAULT '',
`gmt_create` DATETIME NOT NULL DEFAULT '2010-05-05 00:00:00',
`gmt_modified` DATETIME NOT NULL DEFAULT '2010-05-05 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_config_datagroup` (`data_id`,`group_id`)
);
posted @
2013-04-25 14:43 hellxoul 閱讀(334) |
評論 (0) |
編輯 收藏
通過java client鏈接server@import url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
1. 通過設置參數
1 ConnectionFactory factory = new ConnectionFactory();
2 factory.setUsername(userName);
3 factory.setPassword(password);
4 factory.setVirtualHost(virtualHost);
5 factory.setHost(hostName);
6 factory.setPort(portNumber);
7 Connection conn = factory.newConnection();
1 ConnectionFactory factory = new ConnectionFactory();
2 factory.setUri("amqp://userName:password@hostName:portNumber/virtualHost");
3 Connection conn = factory.newConnection();
3.多地址
1 Address[] addrArr = new Address[]{ new Address(hostname1, portnumber1)
2 , new Address(hostname2, portnumber2)};
3 Connection conn = factory.newConnection(addrArr);
posted @
2013-04-11 10:27 hellxoul 閱讀(371) |
評論 (0) |
編輯 收藏
在CentOS下,源碼安裝Erlang:
下載Erlang源碼
安裝:官網地址,http://www.erlang.org
Java代碼
# cd /opt/
# wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
解壓:
Java代碼
# tar -zxvf otp_src_R15B01.tar.gz
# cd otp_src_R15B01
安裝依賴:
Java代碼
# yum install build-essential m4
# yum install openssl
# yum install openssl-devel
# yum install unixODBC
# yum install unixODBC-devel
# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
配置configure
Java代碼
# ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
make
make install
完成之后,設置環境變量
Java代碼
vim /etc/profile
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
完成后保存
Java代碼
source /etc/profile
讓環境變量立即生效
然后輸入erl,出現erlang shell,如下:
Java代碼
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.1 (abort with ^G)
1>
hipe:支持Erlang編譯成本地代碼。好處:提高Erlang虛擬機執行代碼性能。
參考文獻:
[1] http://jinghong.iteye.com/blog/1075165
[2] http://my.oschina.net/hanyu363/blog/29727
[3] http://www.linuxidc.com/Linux/2011-07/39156.htm
rabbitmq啟動:
sbin/rabbitmq-server
rabbitmq-server -detached
停止 rabbitmqctl stop
查看狀態:rabbitmqctl status
插件安裝rabbitmq-plugins enable rabbitmq_management 監控使用
http://www.rabbitmq.com/management.html
@import url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
posted @
2013-04-09 15:20 hellxoul 閱讀(259) |
評論 (0) |
編輯 收藏
只有注冊用戶登錄后才能閱讀該文。
閱讀全文
posted @
2013-04-02 14:28 hellxoul|
編輯 收藏
1.下載MySQL
我下載的版本:mysql-5.5.22.tar.gz
2.安裝之前先卸載CentOS自帶的MySQL
[root@localhost ~]# yum remove mysql
3.編譯安裝Cmake
下載cmake源碼包:http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
從共享目錄移至usr目錄
[root@localhost ~]# mv /mnt/hgfs/Share-CentOS/cmake-2.8.4.tar.gz /usr/cmake-2.8.4.tar.gz
[root@localhost ~]# cd /usr
解壓并安裝cmake
[root@localhost usr]# tar xzvf cmake-2.8.4.tar.gz
[root@localhost usr]# cd cmake-2.8.4
[root@localhost cmake-2.8.4]# ./bootstrap
---------------------------------------------
CMake 2.8.4, Copyright 2000-2009 Kitware, Inc.
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
報錯:缺少C的編譯器
解決辦法:安裝gcc編譯器
[root@localhost ~]# yum install gcc
繼續安裝Cmake
[root@localhost cmake-2.8.4]# ./bootstrap
---------------------------------------------
CMake 2.8.4, Copyright 2000-2009 Kitware, Inc.
C compiler on this system is: cc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
報錯:缺少C++編譯器
解決辦法:安裝gcc-c++編譯器
[root@localhost ~]# yum install gcc-c++
再次安裝
[root@localhost cmake-2.8.4]# ./bootstrap
沒有報錯,編譯安裝
[root@localhost cmake-2.8.4]# gmake
[root@localhost cmake-2.8.4]# gmake install
4.正式開始安裝MySQL
添加MySQL用戶和用戶組
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -g mysql mysql
MySQL源碼包從共享文件夾移至/usr并解壓
[root@localhost ~]mv /mnt/hgfs/Share-CentOS/mysql-5.5.22.tar.gz /usr/mysql-5.5.22.tar.gz
[root@localhost usr]# tar xzvf mysql-5.5.22.tar.gz
[root@localhost usr]# cd mysql-5.5.22
Cmake運行
[root@localhost mysql-5.5.22]# cmake .
開始編譯安裝
[root@localhost mysql-5.5.22]# make && make install
進入安裝目錄,將程序二進制的所有權改為root,數據目錄的說有權改為mysql用戶,更新授權表
[root@localhost mysql-5.5.22]# cd /usr/local/mysql/
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
安全啟動MySQL(默認密碼為空)
[root@localhost mysql]#./bin/mysqld_safe --user=mysql&
報錯:
120908 00:16:25 mysqld_safe Logging to '/usr/local/mysql/data/CentOS.err'.
120908 00:16:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
解決方法:
[root@CentOS ~]# cd /usr/local/mysql/data
[root@CentOS data]# ls -l
總用量 29744
-rw-rw---- 1 mysql root 1585 9月 8 00:16 CentOS.err
-rw-rw---- 1 mysql mysql 6 9月 8 00:16 CentOS.pid
-rw-rw---- 1 mysql mysql 18874368 9月 8 00:16 ibdata1
-rw-rw---- 1 mysql mysql 5242880 9月 8 00:16 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 9月 8 00:16 ib_logfile1
drwxr-xr-x 2 mysql mysql 4096 9月 8 00:14 mysql
-rw-rw---- 1 mysql mysql 27293 9月 8 00:14 mysql-bin.000001
-rw-rw---- 1 mysql mysql 1031892 9月 8 00:14 mysql-bin.000002
-rw-rw---- 1 mysql mysql 107 9月 8 00:16 mysql-bin.000003
-rw-rw---- 1 mysql mysql 57 9月 8 00:16 mysql-bin.index
drwx------ 2 mysql mysql 4096 9月 8 00:14 performance_schema
drwxr-xr-x 2 mysql mysql 4096 9月 8 00:08 test
[root@CentOS data]# chgrp -R mysql CentOS.err
[root@CentOS data]# ls -l
總用量 29736
-rw-rw---- 1 mysql mysql 1585 9月 8 00:16 CentOS.err
-rw-rw---- 1 mysql mysql 6 9月 8 00:16 CentOS.pid
-rw-rw---- 1 mysql mysql 18874368 9月 8 00:16 ibdata1
-rw-rw---- 1 mysql mysql 5242880 9月 8 00:16 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 9月 8 00:16 ib_logfile1
drwxr-xr-x 2 mysql mysql 4096 9月 8 00:14 mysql
-rw-rw---- 1 mysql mysql 27293 9月 8 00:14 mysql-bin.000001
-rw-rw---- 1 mysql mysql 1031892 9月 8 00:14 mysql-bin.000002
-rw-rw---- 1 mysql mysql 107 9月 8 00:16 mysql-bin.000003
-rw-rw---- 1 mysql mysql 57 9月 8 00:16 mysql-bin.index
drwx------ 2 mysql mysql 4096 9月 8 00:14 performance_schema
drwxr-xr-x 2 mysql mysql 4096 9月 8 00:08 test
連接本機MySQL
[root@localhost mysql]#mysql –u root –p
提示輸入password,默認為空,按Enter即可
斷開連接
mysql>exit;
為root賬戶設置密碼
[root@localhost ~]# cd /usr/local/mysql/bin
[root@localhost mysql]# ./bin/mysqladmin -u root password 123456
Enter Password:123456
設置選項文件,將配置文件拷貝到/etc下
[root@localhost mysql]# cp support-files/my-medium.cnf /etc/mysql.cnf
設置開機自啟動
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysql
[root@localhost mysql]# chmod +x /etc/init.d/mysql
[root@localhost mysql]# chkconfig mysql on
通過服務來啟動和關閉Mysql
[root@localhost ~]# service mysql start
[root@localhost ~]# service mysql stop
5.安裝設置完畢,之后使用只需啟動-連接-斷開-關閉,命令如下:
[root@CentOS mysql]# service mysql start
Starting MySQL.. [確定]
[root@CentOS mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.22 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.07 sec)
mysql> exit;
Bye
[root@CentOS mysql]# service mysql stop
Shutting down MySQL. [確定]
6.其它:
查看進程命令 ps –ef|grep mysqld
kill進程命令 kill –9 進程號
posted @
2013-02-24 00:31 hellxoul 閱讀(5504) |
評論 (1) |
編輯 收藏