Mysql5.5安装


下载地址:http://imysql.cn/node/654 包名:mysql-5.5.41.zip

yum安装yum install cmake*

yum install kernel-devel

gcc* gcc-c++* autoconf* automake* zlib* libxml* ncurses-devel* libgcrypt* libtool* openssl*

安装前的系统设置:

Mkdir /usr/local/mysql

Mkdir /usr/local/mysql/data

groupadd mysql

useradd -g mysql mysql

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


cmake编译安装mysql

unzip mysql-5.5.41.zip

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
-DMYSQL_USER=mysql \
-DEXTRA_CHARSETS=all \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1


make && make install

mkdir /usr/local/mysql/log

mkdir /usr/local/mysql/etc

chmod 755 scripts/mysql_install_db

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &

创建管理MySQL数据库的shell脚本

mkdir /usr/local/mysql/init.d
cp support-files/mysql.server /usr/local/mysql/init.d/mysql

chmod +x /usr/local/mysql/init.d/mysql

/etc/init.d/mysql restart


mysqladmin -uroot password '******'初始化密码

support-files/my-medium.cnf拷贝到/etc/my.cnf

如果出现安装不成功,请删除系统默认自带的my.cnf文件,将新生成的拷贝过去


你可能感兴趣的:(mysql,local,下载地址)