centos5.5下源码安装mysql

所需软件下载地址:

http://pan.baidu.com/s/1EUljg

安装mysql

1、解压软件包

2、创建mysql组,建立mysql用户并加入到mysql组中

/usr/sbin/groupadd mysql

/usr/sbin/useradd -g mysql mysql

3、安装

mkdir /usr/local/mysql

tar zxvf mysql-5.1.54.tar.gz

cd mysql-5.1.54

./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables

--with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg

make && make install

4、配置文件

cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

5、修改权限

chmod +w /usr/local/mysql

chown -R mysql:mysql /usr/local/mysql

6、对MySQL进行初始化

/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

7、启动MySQL服务器;该命令无需要修改

/usr/local/mysql/bin/mysqld_safe --user=mysql &

8、进入MySQL应用环境

/usr/local/mysql/bin/mysql -uroot -p

================操作======================

启动

/usr/local/mysql/bin/mysqld_safe&

停止

/usr/local/mysql/bin/mysqladmin shutdown

my.cnf里面添加

[mysqld]

skip-name-resolve

这样速度就快了!

==============添加权限===============

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '';

flush PRIVILEGES;


你可能感兴趣的:(centos5.5,源码安装mysql)