我的mysqld编译初始化命令

5.0mysqld要在GBK字符编码下进行编译。

export LANG=zh_CN.GBK

 

编译:

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti -fomit-frame-pointer -ffixed-ebp"

./configure --prefix=/usr/local/mysql \

--enable-assembler \

--with-mysqld-ldflags=-all-static  \

--with-client-ldflags=-all-static  \

--with-unix-socket-path=/tmp/mysql.sock \

--with-charset=utf8  \

--with-collation=utf8_general_ci \

--with-extra-charsets=all \

--prefix=/data/web/mysql  \

--datadir=/data/web/mysql/var \

--sysconfdir=/data/web/mysql/etc \

--without-isam --with-pthread \

--enable-thread-safe-client \

--with-client-ldflags=-all-static \

--with-mysqld-ldflags=-all-static

 

make

make install

mkdir -p /data/web/mysql/share/mysql/

cp support-files/mysql.server /data/web/mysql/share/mysql/

cp support-files/my-medium.cnf /data/web/mysql/my.cnf

cp support-files/my-medium.cnf /etc/my.cnf

 

初始化数据库

/opt/mysql/bin/mysql_install_db --user=mysql

 

修改root密码:

/data/web/mysql/bin/mysqladmin -uroot password new_pass

你可能感兴趣的:(mysqld)