groupadd mysql
  useradd mysql -g mysql -M -s /sbin/nologin
  rpm -qa mysql
  rpm -e mysql
  rpm -e --nodeps  mysql
  rpm -qa mysql
Mysql5.1安装
 放入mysql.log,然后cat mysql.log|bash

 

./configure \

--prefix=/application/mysql5.1.72 \

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

--localstatedir=/application/mysql5.1.72/data \

--enable-assembler \

--enable-thread-safe-client \

--with-mysqld-user=mysql \

--with-big-tables \

--without-debug \

--with-pthread \

--enable-assembler \

--with-extra-charsets=complex \

--with-readline \

--with-ssl \

--with-embedded-server \

--enable-local-infile \

--with-plugins=partition,innobase \

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

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

#--with-plugin-PLUGIN \

 

 

 

[root@localhost application]# ln -s /application/mysql5.1.72/ /application/mysql

[root@localhost application]# ll /application/mysql

 

 

初始化数据库

Mysql5.1安装
 
cd /home/sun/tools/mysql-5.1.72
cp my-small.cnf  /etc/my.cnf
mkdir /application/mysql/data –p
chown –R mysql.mysql  /application/mysql/
/application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql
Mysql5.1安装

cd /home/sun/tools/mysql-5.1.72

\cp support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld on

/etc/init.d/mysqld start

Mysql5.1安装

 

Mysql5.1安装

第一种方法:

启动:

/application/mysql/bin/mysqld_safe &

关闭:

mysqladmin shutdown

 

第二种:

/etc/init.d/mysqld start

/etc/init.d/mysqld stop

 

 

设置密码

/application/mysql/bin/mysqladmin -u root password "123456"

 

 Mysql5.1安装

 

Mysql5.1安装

 

Mysql5.1安装

 

相关文章: