linux下 yum源、rpm、源代码安装mysql
mysql的安装
一、yum源格式安装mysql
1、将下载的yum包上传到linux上:
[root@localhost ~]# ls
mysql-community-release-el6-5.noarch.rpm
2、列出rpm包中文件(查看哪些内容):
[root@localhost ~]# rpm -qpl mysql-community-release-el6-5.noarch.rpm
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
3、安装rpm包(自动配置好yum源):
[root@localhost ~]# rpm -ivh mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
4、安装mysql:
[root@localhost ~]# yum install mysql-community-server.x86_64 -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 2460.
Another app is currently holding the yum lock; waiting for it to exit... Verifying : mysql-community-libs-5.6.29-2.el6.x86_64 5/8
Verifying : 2:postfix-2.6.6-6.el6_7.1.x86_64 6/8
Verifying : 2:postfix-2.6.6-2.2.el6_1.x86_64 7/8
Verifying : mysql-libs-5.1.71-1.el6.x86_64 8/8
Installed:
mysql-community-libs.x86_64 0:5.6.29-2.el6 mysql-community-libs-compat.x86_64 0:5.6.29-2.el6 mysql-community-server.x86_64 0:5.6.29-2.el6
Dependency Installed:
mysql-community-client.x86_64 0:5.6.29-2.el6 mysql-community-common.x86_64 0:5.6.29-2.el6
Dependency Updated:
postfix.x86_64 2:2.6.6-6.el6_7.1
Replaced:
mysql-libs.x86_64 0:5.1.71-1.el6
Complete!
5、是否安装了mysql:
[root@localhost ~]# rpm -qa | grep mysql
mysql-community-libs-5.6.29-2.el6.x86_64
mysql-community-server-5.6.29-2.el6.x86_64
mysql-community-client-5.6.29-2.el6.x86_64
mysql-community-libs-compat-5.6.29-2.el6.x86_64
mysql-community-release-el6-5.noarch
mysql-community-common-5.6.29-2.el6.x86_64
6、接下来是初始化数据库:
[root@localhost ~]# mysql_install_db --datadir=/var/lib/mysql/
Installing MySQL system tables...2016-03-15 11:00:50 0 [Warning] TIMESTAMP wi
7、更改数据库目录权限并启动mysql:
[root@localhost ~]# chown -R mysql:mysql /var/lib/mysql/
[root@localhost ~]# ll -h /var/lib/mysql/
总用量 109M
-rw-rw----. 1 mysql mysql 12M 3月 15 11:00 ibdata1
-rw-rw----. 1 mysql mysql 48M 3月 15 11:00 ib_logfile0
-rw-rw----. 1 mysql mysql 48M 3月 15 11:00 ib_logfile1
drwx------. 2 mysql mysql 4.0K 3月 15 11:00 mysql
drwx------. 2 mysql mysql 4.0K 3月 15 11:00 performance_schema
[root@localhost ~]# /etc/init.d/mysqld start
正在启动 mysqld: [确定]
8、登录mysql并修改密码:
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.29 MySQL Community Server (GPL) Copyright (c) 2000, 2016, 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> update mysql.user set password=password("123456")where user='root';
Query OK, 3 rows affected (0.11 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.04 sec)
二、RPM方式安装mysql:
1.将下载好的文件上传到Linux下:
[root@localhost Downloads]# ls
MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
2、解压tar文件:
[root@localhost Downloads]# tar -xf MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
[root@localhost Downloads]# ls
MySQL-client-5.6.16-1.el6.x86_64.rpm
MySQL-devel-5.6.16-1.el6.x86_64.rpm
MySQL-embedded-5.6.16-1.el6.x86_64.rpm
MySQL-server-5.6.16-1.el6.x86_64.rpm
MySQL-shared-5.6.16-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.16-1.el6.x86_64.rpm
MySQL-test-5.6.16-1.el6.x86_64.rpm
3、安装rpm文件:
[root@localhost Downloads]# rpm -Uvh MySQL-*
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [ 14%]
2:MySQL-client ########################################### [ 29%]
3:MySQL-test ########################################### [ 43%]
4:MySQL-embedded ########################################### [ 57%]
5:MySQL-shared-compat ########################################### [ 71%]
6:MySQL-shared ########################################### [ 86%]
7:MySQL-server ########################################### [100%]
4、启动mysql服务:
[root@localhost mysql]# /etc/init.d/mysql start
Starting MySQL........ [ OK ]
linux下 yum源、rpm、源代码安装mysql的更多相关文章
- [Linux] 使用Yum在CentOS上安装MySQL
跟随官网上的安装教程:https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html官网上还有一个QuickGuide ...
- 在Linux下用源码编译安装apache2
Linux下安装一个软件,最好去看下它的官方guide,apache2.4的安装安装guide 0. installation guide http://httpd.apache.org/docs/2 ...
- LINUX下YUM源配置
转自:http://www.cnblogs.com/phoebus0501/archive/2010/12/14/1906144.html 1.确保RHEL5中已经安装了yum [root@lvs-m ...
- linux下如何源码编译安装vim
1. 获取源码 git clone https://github.com/vim/vim.git ~/vim cd ~/vim 2. 配置 ./configure --prefix=/home/jel ...
- Linux下DNW源码及安装
平台: Ubuntu12.04 + 64bit tiny4412ADK 1.首先要安装libusb-dev这个库,执行“sudo apt-get install libusb-dev”,装完之后就编译 ...
- Linux下yum安装MySQL
写这篇文章的原因是:在刚开始使用Linux操作系统时想要搭建LAMP环境,于是开始在Google和百度上各种寻找资料,碰到了不是很多的问题后,我决定写这篇文章总结一下在Linux下yum安装MySQL ...
- CentOS 6.6 下源码编译安装MySQL 5.7.5
版权声明:转自:http://www.linuxidc.com/Linux/2015-08/121667.htm 说明:CentOS 6.6 下源码编译安装MySQL 5.7.5 1. 安装相关工具# ...
- CentOS7下通过rpm方式安装MySQL及插入中文问题解决 [原创]
一 CentOS下通过rpm方式安装MySQL CentOS版本:CentOS-7 MySQL版本:MySQL-5.6.22 在网上搜了一下,Linux下安装MYSQL有三种方式: 1) 通过yum命 ...
- 【夯实PHP基础系列】linux下yum安装PHP APC
Alternative PHP Cache(可选PHP缓存),依赖于 PECL扩展库 用源码方式安装,直接yum就行了:首先要安装apc的依赖包:yum install php-pear php-de ...
随机推荐
- 探索ORACLE之ASM概念
一. ASM(自动存储管理)的来由: ASM是Oracle 10g R2中为了简化Oracle数据库的管理而推出来的一项新功能,这是Oracle自己提供的卷管理器,主要用于替代操作系统所提供的 ...
- Spring JdbcTemplate Querying examples
Here are few examples to show you how to use JdbcTemplate query() methods to query or extract data f ...
- eclipse中的js文件报错的解决办法
在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. 右键点击项目->properties->Validation ...
- WEB安全之威胁解析
本文章转载自 http://www.xuebuyuan.com/60198.html 主要威胁: 暴力攻击(brute-force attack):这些攻击通过尝试所有可能的字符组合,以发现用户证书. ...
- myeclipse内存配置
配置文件路径:D:\work\myeclipse\MyEclipse for Spring 10\myeclipseforspring.ini 替换以下内容即可 -vmargs-Xmx768m-XX: ...
- C# Dictionary用法总结
转自:http://www.cnblogs.com/linlf03/archive/2011/12/09/2282574.html http://www.cnblogs.com/linzheng/ar ...
- get_template_part() 函数详解备忘(转)
最近研究官方主题 Twenty Eleven ,有一些东西网上现成的中文资料不好找,在博客里记载下来,算是分享,也算是备忘,wordpress 3.0 以后就开始便有了get_template_par ...
- [GUI]界面开发类库
如果我们不十分清楚需要什么样的界面风格及如何实现,请按以下两个步骤操作: (1) 搞清楚这种风格叫什么名字 (2) 查现有的比较著名的GUI库是否已有相应的实现方案. (3) ...
- cocos2d-x CCTableView
转自:http://www.cnblogs.com/dcxing/archive/2013/01/16/2862068.html CCTableView在游戏中一般用在背包这样场景或层中,当然也不止这 ...
- Apache POI 合并单元格
合并单元格所使用的方法: sheet.addMergedRegion( CellRangeAddress cellRangeAddress ); CellRangeAddress 对象的构造 ...