Centos下源码安装mysql

来源:互联网 发布:西安交大网络缴费 编辑:程序博客网 时间:2024/05/16 07:22

刚刚接触,备忘

yum install gcc
yum install -y gcc-c++


(tar zxvf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --with-shared  --prefix=/usr
make
make install)或者
yum list|grep ncurses
yum -y install ncurses-devel
yum install ncurses-devel

1)
shell> cd /usr/local/src 
shell> groupadd mysql 
shell> useradd mysql -g mysql 
创建mysql用户
shell> tar -xzvf mysql-5.0.51a.tar.gz
shell> cd mysql-5.0.51a
shell> ./configure --prefix=/usr/local/mysql --with-charset=gb2312 --with-extra-charsets=gbk,gb2312
shell> make && make install


shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
修改此目录的所有文件权限,
shell> chown -R mysql.mysql .
为mysql用户生成数据库
shell> bin/mysql_install_db --user=mysql
为安全起见 将原目录权限改回root
shell> chown -R root .
将新生成的存放数据库的目录改回mysql所有以便能够正常启动。
shell> chown -R mysql var


设置mysql开机自动启动
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
chkconfig mysqld on


0 0
原创粉丝点击