源码包:mysql-5.5.15-linux2.6-i686.tar
tar xf mysql-5.5.15-linux2.6-i686.tar -C /usr/local
cd /usr/local ll
ln -sv /usr/local/mysql-5.5.15-linux2.6-i686 /usr/local/mysql
cd mysql
ls
创建一个LVM /dev/myvg/mydata
mke2fs -j -L MYDATA /dev/myvg/mydata
mkdir /mydata
mount /dev/myvg/mydata /mydata
修改/etc/fstab
groupadd -g 3306 mysql
useradd -g mysql -u 3306
cd /mydata
mkdir data
chown -R mysql:mysql /mydata
cd /usr/local/mysql
chown -R mysql:mysql .
数据库初始化 scripts/mysql_install_db --user=mysql --datadir=/mydata/data
chown -R root .改变属主
ls /etc/init.d
ls support-files/
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysql
配置文件:
cp support-files/my-large.cnf /etc/my.cnf
vi /etc/my.cnf --datadir = /mydata/data
启动:service mysqld start
没有mysql命令:
PATH=$PATH:/usr/local/mysql/bin
vi /etc/ld.so.conf.d/mysql.conf --/usr/local/mysql/lib
头文件 ln -sv /usr/local/mysql/include /usr/include/mysql
手册页 vi /etc/man.config --MANPATH=/usr/local/mysql/man