rpm安装mysql服务端_linux 安装MySQL 服务端 并连接远程的MySQL

1:在线安装

yum -y install mysql-server

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

9344520.html

abfa963474096811f930af4990f484ab.png

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值