mysql的rpm安装
2016-04-19 14:42
330 查看
MYSQL在centos6中的安装
MYSQL在centos6中的安装需要下载的包
需要下载三个rpm软件包
安装
修改配置文件位置
初始化MySQL及修改MySQL默认的root密码
设置MySQL服务开机自启动
安装过程的错误的解决
远程连接
需要下载的包
需要下载三个rpm软件包:
MySQL-client-5.6.21-1.rhel5.x86_64.rpmMySQL-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.rpmrpm -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_dbps -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管理他的服务而不是mysqld2、错误描述:
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
相关文章推荐
- MySQL中的integer 数据类型
- MySQL存储过程
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法
- MySQL Server 日志
- MySQL 安全事宜
- MySQL 备份与恢复