IF
CASE
LOOP
LEAVE
ITERATE
REPEAT
WHILE
2014年2月26日 星期三
MySQL 清除 root 密碼
/etc/init.d/mysql stop
/usr/libexec/mysqld --skip-grant-tables --user=root &
mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
/usr/libexec/mysqld --skip-grant-tables --user=root &
mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
建立 CentOS 6.5 OpenVZ Template
安裝 CentOS 6.5
yum install yum-utils
yumdownloader centos-release.x86_64
mkdir -p /newroot/var/lib
touch /newroot/var/lib/random-seed
rpm --rebuilddb --root=/newroot
rpm -i --root=/newroot --nodeps centos-release-6-5.el6.centos.11.2.x86_64.rpm
yum --installroot=/newroot install -y openssh-clients openssh-server yum yum-utils man wget sudo tar passwd
yum --installroot=/newroot clean all
ln -s /proc/mounts /newroot/etc/mtab
rm -f /newroot/dev/null
mknod -m 600 /newroot/dev/console c 5 1
編輯 /newroot/etc/fstab 內容如下
none /dev/pts devpts rw,gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
修改 /newroot/etc/sysconfig/init
ACTIVE_CONSOLES=/dev/tty[1-6]
取代為
ACTIVE_CONSOLES=
tar zcf /root/centos-6-x86_64.tar.gz -C /newroot .
yum install yum-utils
yumdownloader centos-release.x86_64
mkdir -p /newroot/var/lib
touch /newroot/var/lib/random-seed
rpm --rebuilddb --root=/newroot
rpm -i --root=/newroot --nodeps centos-release-6-5.el6.centos.11.2.x86_64.rpm
yum --installroot=/newroot install -y openssh-clients openssh-server yum yum-utils man wget sudo tar passwd
yum --installroot=/newroot clean all
ln -s /proc/mounts /newroot/etc/mtab
rm -f /newroot/dev/null
mknod -m 600 /newroot/dev/console c 5 1
編輯 /newroot/etc/fstab 內容如下
none /dev/pts devpts rw,gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
修改 /newroot/etc/sysconfig/init
ACTIVE_CONSOLES=/dev/tty[1-6]
取代為
ACTIVE_CONSOLES=
tar zcf /root/centos-6-x86_64.tar.gz -C /newroot .
2014年2月17日 星期一
CentOS release 6.5 (64bit) 安裝 MySQL lib_mysqludf_sys 筆記
yum install mysql-devel
yum install git
git clone https://github.com/mysqludf/lib_mysqludf_sys
cd lib_mysqludf_sys/
修改 Makefile內容
gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib64/mysql/plugin/lib_mysqludf_sys.so -fPIC
make
mysql -u root mysql < lib_mysqludf_sys.sql
yum install git
git clone https://github.com/mysqludf/lib_mysqludf_sys
cd lib_mysqludf_sys/
修改 Makefile內容
gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib64/mysql/plugin/lib_mysqludf_sys.so -fPIC
make
mysql -u root mysql < lib_mysqludf_sys.sql
2014年2月13日 星期四
C#筆記-剖析設定檔
讀取 txt.txt 檔案,以"="為分隔符號,儲存在 dictory 變數中
txt.txt 檔案內容
one= 11
two=22
three =33
four=44
five=55
using System;
using System.Collections.Generic;
txt.txt 檔案內容
one= 11
two=22
three =33
four=44
five=55
using System;
using System.Collections.Generic;
class Program { static void Main(string[] args) { DictionaryvarWith = new Dictionary ( ); varWith.Add("one", ""); varWith.Add("two", ""); varWith.Add("three", ""); varWith.Add("four", ""); varWith.Add("five", ""); string[] lines = System.IO.File.ReadAllLines(@"txt.txt"); foreach (string line in lines) { if(line.IndexOf("=")<1 console.writeline="" continue="" foreach="" if="" in="" kvp.key="" kvp.value="" kvp="" line.indexof="" line.substring="" pre="" rim="" t="" var="" varwith.containskey="" varwith="">1>
訂閱:
文章 (Atom)