one js validation framework
http://niceue.com/validator/demo/twitter-js.php?theme=yellow_right_effect
posted @
2013-10-10 10:37 hellxoul 阅读(351) |
评论 (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 阅读(249) |
评论 (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 阅读(277) |
评论 (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 阅读(13973) |
评论 (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 阅读(494) |
评论 (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 阅读(324) |
评论 (0) |
编辑 收藏
通过java client链接server@import url(http://www.blogjava.net/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 阅读(363) |
评论 (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.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
posted @
2013-04-09 15:20 hellxoul 阅读(253) |
评论 (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 阅读(5491) |
评论 (1) |
编辑 收藏