groupadd mysql
useradd -g mysql mysql
CFLAGS="-O3 -mpentiumpro" CXX=gcc \
CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" \
./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static \
--with-charset=gb2312 \
--with-extra-charsets=complex
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
cp mysql.server /etc/init.d/mysqld
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
修改/etc/my.cnf
[mysqld]
set-variable = max_connections=100
default-character-set = utf8
修改root和匿名账户的密码
/usr/local/mysql/bin/mysql -uroot
UPDATE user SET Password=PASSWORD('new_password') WHERE user='root';
FLUSH PRIVILEGES;
UPDATE user set password=PASSWORD('yournewpassword') where user='';
FLUSH PRIVILEGES;
增加新用户
GRANT ALL ON databasename.* TO username@192.168.128.0/17 IDENTIFIED BY "password"
CFLAGS="-O3 -mpentiumpro" CXX=gcc \
CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" \
./configure \
--prefix=/opt/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-charset-utf8 \
--localstatedir=/opt/mysqldata
阅读(1910) | 评论(0) | 转发(0) |