MySQL的安装
Mysql的安装还是比较简单的。
首先去下载源码包,注意选择Source。
一路编译,安装。
参考:
http://dev.mysql.com/doc/refman/5.1/zh/installing.html#quick-install
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
我编译用的是这个参数:
./configure --prefix=/usr/local/mysql --with-comment=Source --with-server-suffix=-Nau_MySQL --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-isam --without-innodb --without-ndb-debug
安装好之后,记得给MySQL设置一个密码
mysqladmin uroot -password123456
或者
shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd');
http://dev.mysql.com/doc/refman/5.1/zh/installing.html#default-privileges