全部博文(535)
分类: LINUX
2011-05-05 18:06:48
groupadd mysql
useradd -g mysql mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/
cd /usr/local/mysql/scripts/
./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysqld_safe --user=mysql &
# 增加服务,需修改mysqld中的basedir和datadir
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
# chmod 很重要,不然会启动不了
chmod 755 /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
# 配置文件增加utf8
vi /etc/my.cnf
16. # 增加以下内容
[mysqld]
character-set-server = utf8
collation_server = utf8_unicode_ci
service mysqld start