MYSQL的安装 创建运行mysql的用户 #cd /backup # groupadd mysql # useradd -g mysql mysql 安装mysql的安装包 #gunzip mysql-4.0.21-sol9-sparc-local.gz #pkgadd –d mysql-4.0.21-sol9-sparc-local 安装完后,在/usr/local/下多一个mysql的目录,我们对它进行设置 #cd /usr/local/mysql #cd scripts #./mysql_install_db –user=mysql #chown –R root /usr/local/mysql #chgrp –R mysql /usr/local/mysql #cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf 试运行一个mysql服务; #cd /usr/local/mysql/bin #./mysqld_safe –user=mysql& 如果没出错误错的话,就说明成功,如果出现: Starting mysqld daemon with databases from /usr/local/mysql/var STOPPING server from pid file /usr/local/mysql/var/bad.com.pid 050407 01:44:15 mysqld ended 说明没有成功,看/usr/local/mysql/var/bad.com.err,这个错误可以用 #chown mysql:mysql /usr/local/mysql/var/mysql解决(我刚开的时候就是因为这个,弄了了半天没装好。
试一个mysql是不是可用 # ./mysql -u root -p Enter password密码为空) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.0.21-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>; show databases; +----------+ | Database | +----------+ | mysql | | test | +----------+ 2 rows in set (0.06 sec)