mysql的rpm安装

MYSQL在centos6中的安装

需要下载的包

需要下载三个rpm软件包:

MySQL-client-5.6.21-1.rhel5.x86_64.rpm
MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
MySQL-server-5.6.21-1.rhel5.x86_64.rpm

下载地址下载地址引用处
http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

安装

rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm
可能需要安装:libaio
yum install -y libaio

修改配置文件位置。

[root@linuxidc tools]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

初始化MySQL及修改MySQL默认的root密码。

/usr/bin/mysql_install_db
ps -ef | grep mysql
netstat -anpt | grep 3306
more /root/.mysql_secret

mysql -uroot -pF6K3v_xggFoLQeiN
mysql> SET PASSWORD = PASSWORD(‘mima’);

[root@linuxidc tools]# mysql -uroot -pmima
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.21 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

设置MySQL服务开机自启动。

[root@linuxidc tools]# chkconfig mysql on
[root@linuxidc tools]# chkconfig mysql –list

安装过程的错误的解决

1、重点在centos6中使用mysql管理他的服务而不是mysqld
2、错误描述:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)这个问题属于mysql的服务没有开启。

解决方法:

systemctl start mysql(centos7)
service mysql start(centos6)

3、错误描述:

file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.21-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64

解决办法:

 yum remove mysql-libs

远程连接

1、mysql中执行

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

这样在物理机的外面就可以访问vm中的linux了。

引用:http://www.linuxidc.com/Linux/2015-01/111413.htm

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值