MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下产品。MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。
在各主机中,指定 YUM 仓库至 FTP,编写 YUM 配置文件。
#rm -rf /etc/yum.repos.d/*
#vim /etc/yum.repos.d/server.repo [server] name=server baseurl=file:///media gpgcheck=0 # vim /etc/rc.local umount /dev/cdrom mount /dev/cdrom /media/
#yum clean all
#umount /dev/sr0 #mount /dev/sr0 /media
#yum list
#yum groupinstall “Development tools” #yum install lib* ncurses*
#vim /etc/sysconfig/selinux SELINUX=disabled #iptables -F #service iptables save
点我下载软件包 #tar -zxvf mysql-5.1.44.tar.gz -C /usr/src/
#useradd -M -s /sbin/nologin mysql #cd /usr/src/mysql-5.1.44/ #./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql Thank you for choosing MySQL! Remember to check the platform specific part of the reference manual for hints about installing MySQL on your platform. Also have a look at the files in the Docs directory. #make #make install
#cp support-files/my-medium.cnf /etc/my.cnf
#/usr/local/mysql/bin/mysql_install_db --user=mysql
#chown -R root:mysql /usr/local/mysql #chown -R mysql /usr/local/mysql/var
#echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf #ldconfig
#/usr/local/mysql/bin/mysqld_safe --user=mysql & #cp support-files/mysql.server /etc/init.d/mysqld #chmod +x /etc/init.d/mysqld #chkconfig --add mysqld #chkconfig mysqld on
#vim /etc/profile export PATH=$PATH:/usr/local/mysql/bin/ #source /etc/profile
#mysqladmin -u root password redhat #mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 5.1.44-log Source distribution Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> SHOW DATABASES; ±-----------------------+ | Database | ±-----------------------+ | information_schema | | mysql | | test | ±-----------------------+ 4 rows in set (0.12 sec) mysql> EXIT
#mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 83 Server version: 5.1.44-log Source distribution Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> CREATE DATABASE bbs; Query OK, 1 row affected (0.00 sec) mysql> EXIT Bye