Linux Mysql5.5 安裝教程圖解
Step 1: 下載Mysql5.5文件
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.60.tar.gz
Step 2: 解壓縮Mysql5.5文件
tar zxvf mysql-5.5.60.tar.gz cd mysql-5.5.60
Step 3: 安裝依賴庫
yum install -y cmake gcc gcc-c++ bison yum install -y ncurses-devel yum install -y openssl-devel
Step 4: 創建mysql用戶
groupadd mysql useradd -r -g mysql mysql
Step 5: 配置mysql
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \ -DWITH_SSL=system \ -DWITH_ZLIB=system \ -DWITH_LIBWRAP=0 \ -DWITH_READLINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DENABLED_PROFILING=1
Step 6: 編譯并安裝mysql
make make install
Step 7: 初始化mysql
cd /usr/local/mysql scripts/mysql_install_db --user=mysql
Step 8: 修改權限分配
chown -R mysql:mysql /usr/local/mysql/ chown -R mysql:mysql /data/mysql/
Step 9: 啟動mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
Step 10: 設置root用戶密碼
/usr/local/mysql/bin/mysql_secure_installation
到此,Mysql5.5安裝已經完成。