mysql5 rpm linux 安装过程 博客分类: 技术简介 LinuxMySQLCentOSOSAccess
mysql5 rpm linux 安装过程
MySQL-client-community-5.1.45-1.rhel5.i386.rpm
MySQL-server-community-5.1.44-1.rhel5.i386.rpm
说明如下:
1:用户root用户进入/usr/local
2: 上传:
MySQL-client-community-5.1.45-1.rhel5.i386.rpm
MySQL-server-community-5.1.44-1.rhel5.i386.rpm
3: 执行:
rpm -ivh MySQL-server-community-5.1.44-1.rhel5.i386.rpm
rpm -ivh MySQL-client-community-5.1.45-1.rhel5.i386.rpm
报错:
rpm -ivh MySQL-server-community-5.1.44-1.rhel5.i386.rpm
警告:MySQL-server-community-5.1.44-1.rhel5.i386.rpm: V3 DSA ?章:NOKEY, key ID 5072e1f5
??:相依性失?:
libc.so.6(GLIBC_2.4) 是 MySQL-server-community-5.1.44-1.rhel5.i386 所需要的
rtld(GNU_HASH) 是 MySQL-server-community-5.1.44-1.rhel5.i386 所需要的
MySQL ? mysql-4.1.22-2.el4.i386 相?突
[root@czydmmsapp local]# rpm -ivh MySQL-client-community-5.1.44-1.rhel5.i386.rpm
??:?? MySQL-client-community-5.1.44-1.rhel5.i386.rpm 失?:没有那个文件或目录
[root@czydmmsapp local]# rpm -ivh MySQL-server-community-5.1.44-1.rhel5.i386.rpm
警告:MySQL-server-community-5.1.44-1.rhel5.i386.rpm: V3 DSA ?章:NOKEY, key ID 5072e1f5
??:相依性失?:
libc.so.6(GLIBC_2.4) 是 MySQL-server-community-5.1.44-1.rhel5.i386 所需要的
rtld(GNU_HASH) 是 MySQL-server-community-5.1.44-1.rhel5.i386 所需要的
MySQL ? mysql-4.1.22-2.el4.i386 相?突
说是已经安装了另一版本。
用 rpm -e --nodeps mysql-4.1.22-2.el4.i386 删除它。
rpm -qa | grep mysql 或: rpm -qa | grep -i '^mysql-'
rm -rf /usr/include/mysql
rm -rf /usr/lib/mysql
rpm –e mod_auth_mysql
4:然后进入mysql。 直接输入mysql就行了,因为刚开始mysql还没有设置密码。需要手动去修改
5:进入mysql数据库:use mysql,Database changed
查看一下root的情况:select user, password from user;
6: 修改密码:
update user set password=PASSWORD("czyd(2010)") where user='root';
最好在执行一下:commit
7:ip访问
then: select host, user from user;
mysql> select host, user from user;
+-----------------------+------+
| host | user |
+-----------------------+------+
| % | test |
| 127.0.0.1 | root |
| localhost | |
| localhost | root |
| localhost | test |
| localhost.localdomain | |
| localhost.localdomain | root |
+-----------------------+------+
7 rows in set (0.00 sec)
然后修改一个root用户的host为你的ip地址
update user u set u.host = 'your_ipaddress' where u.user = root and u.host = 'localhost';
update user u set u.host = '192.168.1.42' where u.user = root and u.host = 'localhost';
mysql> select host, user from user;
+-----------------------+------+
| host | user |
+-----------------------+------+
| % | test |
| 127.0.0.1 | root |
| 192.168.1.42 | root |
| localhost | test |
| localhost.localdomain | root |
+-----------------------+------+
5 rows in set (0.00 sec)
8:重启: service mysqld restart
9:退出mysql:exit;
强制安装
rpm -ivh *.rpm --force --nodeps
/////////替换
rpm -ivh --replacefiles **.rpm
[root@czydmmsapp local]# rpm -ivh *.rpm --force --nodeps
警告:MySQL-client-community-5.1.45-1.rhel5.i386.rpm: V3 DSA ?章:NOKEY, key ID 5072e1f5
??中... ########################################### [100%]
1:MySQL-server-community ########################################### [ 50%]
/usr/bin/my_print_defaults: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
/usr/sbin/mysqld: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.
You can try to start the mysqld daemon with:
shell> /usr/sbin/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com/. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!
Notes regarding SELinux on this platform:
=========================================
The default policy might cause server startup to fail because it is
not allowed to access critical files. In this case, please update
your installation.
The default policy might also cause inavailability of SSL related
features because the server is not allowed to access /dev/random
and /dev/urandom. If this is a problem, please do the following:
1) install selinux-policy-targeted-sources from your OS vendor
2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:
allow mysqld_t random_device_t:chr_file read;
allow mysqld_t urandom_device_t:chr_file read;
3) cd to /etc/selinux/targeted/src/policy and issue the following command:
make load
/usr/bin/my_print_defaults: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
/usr/bin/my_print_defaults: error while loading shared libraries: requires glibc 2.5 or later dynamic linker
Starting MySQL.Manager of pid-file quit without updating file.[FAILED]
Giving mysqld 2 seconds to start
2:MySQL-client-community ########################################### [100%]
日,没安装成功。