1:在线安装

   yum -y install mysql-server 

2:手动安装   下载对应的rpm


rpm -ivh 安装包  == 安装

rpm -Uvh 安装包  == 更新

过程丢失库文件问题

libc.so.6 is needed by perl-DBI-1.609-4.el6.i686
libc.so.6(GLIBC_2.0) is needed by perl-DBI-1.609-4.el6.i686
libc.so.6(GLIBC_2.1.3) is needed by perl-DBI-1.609-4.el6.i686
libc.so.6(GLIBC_2.3) is needed by perl-DBI-1.609-4.el6.i686
libc.so.6(GLIBC_2.3.4) is needed by perl-DBI-1.609-4.el6.i686


解决方法:2.1:查找依赖库

[root@fei ~]# yum provides libc.so.6 

已加载插件:fastestmirror, refresh-packagekit, security
base                                                                                                                          | 3.7 kB     00:00     
base/primary_db                                                                                                               | 4.7 MB     01:16     
extras                                                                                                                        | 3.4 kB     00:00     
extras/primary_db                                                                                                             |  37 kB     00:00     
updates                                                                                                                       | 3.4 kB     00:00     
updates/primary_db                                                                                                            | 5.4 MB     00:28     
glibc-2.12-1.192.el6.i686 : The GNU libc libraries
Repo        : base
匹配来自于:
Other       : libc.so.6

2.2下载安装对应要依赖库

(1)看下本地有没有  

yum list glibc 

如果有本地有 就直接安装 yum install glibc.i686

如果没有没有:下载glibc-2.12-1.192.el6.i686.rpm 文件,再用rpm -ivh  glibc-2.12-1.192.el6.i686.rpm


3.启动MySQL

[root@fei ~]# service mysqld start
初始化 MySQL 数据库: WARNING: The host 'fei.zhou' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h fei.zhou password 'new-password'


设置用户名密码:

/usr/bin/mysqladmin -u root password 'root'

登录:

[root@fei ~]# mysql -u root -p
Enter password: 


4:连接远程的MySQL

4.1远程的的数据库 user表 ,其中host :% 代表所有的ip都可以连接,如果需要指定的ip连接,host:指定的ip
| host | user | password                                  |
+------+------+-------------------------------------------+
| %    | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+------+-------------------------------------------+

4.2表结构改成这样后:需要刷新权限

mysql> flush privileges;

4.3 远程的机器连接


[root@fei ~]# mysql -u root -p -h 连接的MySQL服务器所在的电脑IP



posted on 2017-03-25 21:39  2637282556  阅读(159)  评论(0编辑  收藏  举报