下載安裝檔案
將下載檔案複製到/usr/local下
# cd /usr/local
解壓mysql
# tar -zvxf mysql-5.0.41-linux-i686-glibc23.tar.gz
重新命名
# mv mysql-5.0.41-linux-i686-glibc23 mysql
# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
添加mysql使用者及使用者組
# groupadd mysql
# useradd -g mysql mysql
修改mysql目錄許可權
# chown -R root /usr/local/mysql
# chgrp -R mysql /usr/local/mysql
# chown -R mysql /usr/local/mysql/data
產生mysql系統資料庫
# /usr/local/mysql/scripts/mysql_install_db --user=mysql&
啟動mysql服務
# /usr/local/mysql/bin/mysqld_safe --user=mysql&
如出現 Starting mysqld daemon with databases from /usr/local/mysql/data
代表正常啟動mysql服務了, 按Ctrl + C 跳出
建立mysql資料庫
[root@olivenan home]# mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 79
Server version: 5.0.41-log MySQL Community Server (GPL)
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> create database freequery;
建立使用者
mysql> grant all on *.* to freequery@"%" identified by "freequery";