鼎鼎大名的數據庫MySQL,最簡單的安裝過程如下:
1.下載:mysql-4.1.20.tar.gz(www.MySQL.org)
2.//創建用戶與組
[root@localhost root]#groupadd mysql [root@localhost root]#useradd -g mysql MySQL
3.//解壓
[root@localhost root]#tar zxvf MySQL-4.1.20.tar.gz
4.//安裝
[root@localhost root]#cd mysql-4.1.20 [root@localhost mysql-4.1.20]# mkdir /opt/mysq [root@localhost mysql-4.1.20]# ./configure --prefix=/opt/mysql [root@localhost mysql-4.1.20]# make [root@localhost MySQL-4.1.20]# make install
5.//配置
[root@localhost mysql-4.1.20]# cd support-files/ [root@localhost support-files]# cp my-medium.cnf /etc/my.cnf [root@localhost support-files]# cd /opt/mysql/bin [root@localhost bin]# ./mysql_install_db --user=mysql [root@localhost bin]# cd .. [root@localhost mysql]# chown -R root . [root@localhost mysql]# chown -R mysql var [root@localhost mysql]# chgrp -R mysql . [root@localhost mysql]# cd bin [root@localhost bin]# ./MySQLadmin -u root passWord 123456
6.//啟動與登陸
[root@localhost bin]# ./mysqld_safe --user=mysql & [root@localhost bin]# ./mysql -u root -p Enter passWord: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 to server version: 4.1.20-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +----------+ | Database | +----------+ | mysql | | test | | test1 | +----------+ 3 rows in set (0.00 sec) MySQL> exit Bye
7.//開機啟動
方法是將"/opt/mysql/bin/mysqld_safe --user=MySQL &"加入到"/etc/rc.local"文件中來實現隨機啟動.