# make
# make install
# ./scripts/MySQL_install_db
# cd /usr/local
# groupadd MySQL
# useradd mysql -g MySQL -M -s /sbin/nologin
# chmod 750 MySQL -R
# chgrp mysql MySQL -R
# chown mysql MySQL/var -R
# chown -R mysql.mysql /usr/local/MySQL/var
# cd /home/software/MySQL-4.0.17
# cp ./support-files/my-medium.cnf /etc/my.cnf -fv
# cp support-files/mysql.server /etc/init.d/mysqld \copy啟動的MySQLd文件
# chmod 700 /etc/init.d/MySQLd
# cd /usr/local/MySQL/libexec
# cp mysqld MySQLd.old
# strip MySQLd
# chkconfig --add MySQLd
# chkconfig --level 345 MySQLd on
# service MySQLd start
pstree |grep mysqld \查看MySQL有沒有正常啟動
# ln -s /usr/local/mysql/bin/mysql /sbin/MySQL
# ln -s /usr/local/mysql/bin/mysqladmin /sbin/MySQLadmin
# ln -s /usr/local/mysql/bin/mysqldump /sbin/MySQLdump
為了執行命令方便。
增加root用戶的密碼:
#MySQLadmin -u root password 'yourpassWord'
# MySQL -uroot -p
# 輸入你設置的密碼
mysql>use MySQL;
MySQL>delete from user where passWord=""; #刪除用於本機匿名連接的空密碼帳號
MySQL>flush privileges;
MySQL>quit
設置my.cnf文件:
cd /etc/my.cnf
vi my.cnf
[clIEnt]
socket = /var/lib/mysql/MySQL.sock
[MySQLd]
port=3306
socket = /var/lib/mysql/MySQL.sock
set-variable = key_buffer_size=16M
set-variable = max_allowed_packet=1M
set-variable = innodb_buffer_pool_size=256M
set-variable = innodb_additional_mem_pool_size=128M
set-variable = innodb_log_file_size=64M
set-variable = innod