mysql的搭建
yum install gcc*
yum install ncurses-dev*
groupadd mysql
useradd -g mysql mysql
mkdir /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
tar zxvf mysql-5.1.55
cd mysql-5.1.55
./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=complex
make
make install
/usr/local/mysql/bin/mysql_install_db
chown -R mysql /var/lib/mysql
cp /usr/local/src/mysql-5.1.55/support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysqladmin -u root -p password '123456'
登录mysql试试:
/usr/local/mysql/bin/mysql -u root -p
拷贝编译目录的一个脚本,设置开机自动启动
cp /usr/local/src/mysql-5.1.55/support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/init.d/mysqld
chkconfig -add mysqld
chkconfig -del mysql
chkconfig -level 345 mysqld on
/etc/init.d/mysqld restart
查看3306端口是否打开。要注意在防火墙中开放该端口
netstat -atln | grep 3306
netstat -anp | grep mysqld
阅读(2014) | 评论(0) | 转发(1) |