mysql5.1 install for RH9
时间:2006-08-02 来源:herolyh
我下载的版本是mysql-5.1.11-beta-linux-i686-glibc23.tar.gz
该版本为二进制版本,不需要重新编译。
1)安装环境:
Linux RedHat9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
mysql下载地址:http://dev.mysql.com/downloads/mysql/5.1.html
Linux (non RPM package) downloads (platform notes)
Linux(x86)
2)安装步骤:(参考安装包里面的INSTALL-BINARY文档)
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
shell> cd mysql shell> cp support-files/my-medium.cnf /etc/my.cnf(这点很关键,安装文档中没有提到)
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql & 3)如果在 运行bin/mysqld_dafe --user=mysql & 后没有提示 mysqld ended,表示正常启动了。 4)修改root密码 shell> mysql -u root -p (直接回车可以登陆) mysql>use mysq; mysql>update user set password=old_password('NEWPWD'); mysql>flush privilegs; mysql>quit; shell>mysql -u root -p 输入新密码,应该可以登陆成功 mysql> 5)增加用户 shell>mysql -u root -p mysql>grant select,insert,update,delete on testdb.* to 'user1'@'localhost' identified by 'user1';(只能在本地登陆) mysql>use mysql; mysql>set password for 'user1'@'localhost' = old_password('NEWPWD'); mysql>flush privileges; (user1可以从本地登陆了) mysql>grant all privileges on testdb.* to 'user1'@'%' identified by 'user1' with grant option; mysql>use mysql; mysql>set password for 'user1'@'%' = old_password('NEWPWD'); mysql>flush privileges;(user1可以远程登陆了) 6) 关闭服务器 killall -TERM mysqld 忽略授权,启动服务器 bin/mysqld_safe --skip-grant-tables &(本地root不需要密码可登陆)
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
shell> cd mysql shell> cp support-files/my-medium.cnf /etc/my.cnf(这点很关键,安装文档中没有提到)
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql & 3)如果在 运行bin/mysqld_dafe --user=mysql & 后没有提示 mysqld ended,表示正常启动了。 4)修改root密码 shell> mysql -u root -p (直接回车可以登陆) mysql>use mysq; mysql>update user set password=old_password('NEWPWD'); mysql>flush privilegs; mysql>quit; shell>mysql -u root -p 输入新密码,应该可以登陆成功 mysql> 5)增加用户 shell>mysql -u root -p mysql>grant select,insert,update,delete on testdb.* to 'user1'@'localhost' identified by 'user1';(只能在本地登陆) mysql>use mysql; mysql>set password for 'user1'@'localhost' = old_password('NEWPWD'); mysql>flush privileges; (user1可以从本地登陆了) mysql>grant all privileges on testdb.* to 'user1'@'%' identified by 'user1' with grant option; mysql>use mysql; mysql>set password for 'user1'@'%' = old_password('NEWPWD'); mysql>flush privileges;(user1可以远程登陆了) 6) 关闭服务器 killall -TERM mysqld 忽略授权,启动服务器 bin/mysqld_safe --skip-grant-tables &(本地root不需要密码可登陆)
相关阅读 更多 +