用yum安装后,执行service命令启动:

[root@centos ~]# yum install mysql-server
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.i686 :5.1.-.el6_8 will be installed
--> Processing Dependency: mysql = 5.1.-.el6_8 for package: mysql-server-5.1.-.el6_8.i686
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.-.el6_8.i686
--> Processing Dependency: libmysqlclient_r.so.(libmysqlclient_16) for package: mysql-server-5.1.-.el6_8.i686
--> Processing Dependency: libmysqlclient_r.so. for package: mysql-server-5.1.-.el6_8.i686
--> Processing Dependency: libmysqlclient.so.(libmysqlclient_16) for package: mysql-server-5.1.-.el6_8.i686
--> Processing Dependency: libmysqlclient.so. for package: mysql-server-5.1.-.el6_8.i686
--> Running transaction check
---> Package mysql.i686 :5.1.-.el6_8 will be installed
---> Package mysql-libs.i686 :5.1.-.el6_8 will be installed
---> Package perl-DBD-MySQL.i686 :4.013-.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
mysql-server i686 5.1.-.el6_8 os 8.8 M
Installing for dependencies:
mysql i686 5.1.-.el6_8 os k
mysql-libs i686 5.1.-.el6_8 os 1.2 M
perl-DBD-MySQL i686 4.013-.el6 os k Transaction Summary
=======================================================================================================================================================================
Install Package(s) Total download size: M
Installed size: M
Is this ok [y/N]: y
Downloading Packages:
(/): mysql-5.1.-.el6_8.i686.rpm | kB :
(/): mysql-libs-5.1.-.el6_8.i686.rpm | 1.2 MB :
(/): mysql-server-5.1.-.el6_8.i686.rpm | 8.8 MB :
(/): perl-DBD-MySQL-4.013-.el6.i686.rpm | kB :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | MB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-libs-5.1.-.el6_8.i686 /
Installing : perl-DBD-MySQL-4.013-.el6.i686 /
Installing : mysql-5.1.-.el6_8.i686 /
Installing : mysql-server-5.1.-.el6_8.i686 /
Verifying : mysql-server-5.1.-.el6_8.i686 /
Verifying : mysql-libs-5.1.-.el6_8.i686 /
Verifying : perl-DBD-MySQL-4.013-.el6.i686 /
Verifying : mysql-5.1.-.el6_8.i686 / Installed:
mysql-server.i686 :5.1.-.el6_8 Dependency Installed:
mysql.i686 :5.1.-.el6_8 mysql-libs.i686 :5.1.-.el6_8 perl-DBD-MySQL.i686 :4.013-.el6 Complete!
[root@centos ~]# service mysqld start
Initializing MySQL database: 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 centos password 'new-password' Alternatively you can run:
/usr/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! [ OK ]
Starting mysqld: [ OK ]

  我们看到6.9的centos安装的mysql是5.1.73版本的,虽然比较老,毕竟还能用。

  接着设置root用户密码:

[root@centos ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.1. Source distribution Copyright (c) , , 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>
mysql>
mysql>
mysql> select user,password,host from mysql.user;
+------+----------+-------------------+
| user | password | host |
+------+----------+-------------------+
| root | | localhost |
| root | | centos |
| root | | 127.0.0.1 |
| | | localhost |
| | | centos |
+------+----------+-------------------+
rows in set (0.00 sec) mysql> set password for root@localhost=password('');
Query OK, rows affected (0.00 sec) mysql> select user,password,host from mysql.user;
+------+-------------------------------------------+-------------------+
| user | password | host |
+------+-------------------------------------------+-------------------+
| root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | localhost |
| root | | centos |
| root | | 127.0.0.1 |
| | | localhost |
| | | centos |
+------+-------------------------------------------+-------------------+
rows in set (0.00 sec)

  接着就可以开始玩了。

centos的6.9版本安装mysql的更多相关文章

  1. CentOS 6.5以上版本安装mysql 5.7 完整版教程(修订版)

    转载自:https://codeday.me/collect/20170524/21861.html 1: 检测系统是否自带安装mysql # yum list installed | grep my ...

  2. CentOS 7下源码安装MySQL 5.7

    网上说linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有几十M左右,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点 ...

  3. CentOS双机中Docker下安装Mysql并配置互为主从模式

    CentOS双机中Docker下安装Mysql并配置互为主从模式 目录 1.搜索镜像... 1 2.拉取镜像... 1 3.绑定端口: 1 4.配置文件(修改/etc/mysql/my.cnf文件): ...

  4. Centos 7 官网下载安装mysql server 5.6

    Centos 7 官网下载安装 mysql server # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rp ...

  5. centOS Linux下用yum安装mysql

    centOS Linux下用yum安装mysql      第一篇:安装和配置MySQL   第一步:安装MySQL   [root@192 local]# yum -y install mysql- ...

  6. CentOS 6.4下编译安装MySQL 5.6.14

    概述: CentOS 6.4下通过yum安装的MySQL是5.1版的,比较老,所以就想通过源代码安装高版本的5.6.14. 正文: 一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server ...

  7. CentOS 7.2 yum方式安装MySQL 5.7

    CentOS 7之后的版本yum的默认源中使用MariaDB替代原先MySQL,因此安装方式较为以往有一些改变: 下载mysql的源 wget http://dev.mysql.com/get/mys ...

  8. CentOS 7下源码安装MySQL 5.6

    本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...

  9. CentOS 6.4 源码安装MySQL 5.6

    1.安装前准备工作 1.1 必备的包 gcc/g++ :MySQL 5.6开始,需要使用g++进行编译.cmake :MySQL 5.5开始,使用cmake进行工程管理,cmake需要2.8以上版本. ...

随机推荐

  1. Django之路——8 cookie 和sessions

    会话跟踪技术 1 什么是会话跟踪技术 我们需要先了解一下什么是会话!可以把会话理解为客户端与服务器之间的一次会晤,在一次会晤中可能会包含多次请求和响应.例如你给10086打个电话,你就是客户端,而10 ...

  2. POJ2282 The Counting Problem

    题意 Language:DefaultEspañol The Counting Problem Time Limit: 3000MS Memory Limit: 65536K Total Submis ...

  3. 十.Protobuf3 JSON映射

    Protobuf3 JSON映射 proto 3支持JSON中的规范编码,使得系统之间更容易共享数据.下表按类型对编码进行了描述. 如果JSON编码的数据中缺少一个值,或者如果它的值为null,那么当 ...

  4. Linux PXE 网络装机

    一.基础网络建设 Linux配置静态IP-192.168.5.1 # vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT= ...

  5. LightOJ - 1170 - Counting Perfect BST(卡特兰数)

    链接: https://vjudge.net/problem/LightOJ-1170 题意: BST is the acronym for Binary Search Tree. A BST is ...

  6. 洛谷 AT2434 JOI 公園 (JOI Park) 题解

    人生第一次AC黑题,我太感动了. 每日一题 day31 打卡 Analysis 先跑遍DJ,求出1到 i的最短路.得到每个点到 1号点的距离后,从小到大排序一遍,这时便可以枚举每个点到 1号点的距离修 ...

  7. RookeyFrame Bug 编号显示 系统自动生成 的问题,有时候依旧会显示text文本框

    编号显示 系统自动生成 的问题,有时候依旧会显示text文本框 1.在线新建model -> 启用编码规则 -> 新建字段Code(主键) 2.跟Code字段 创建编码规则 3.新增菜单 ...

  8. csp-s模拟测试93T2口胡(蒟蒻的口胡大家显然就不用看了吧

    我们先证正确性,再证复杂度 以下记$\left \langle i,j \right \rangle$为考虑$\left [ i,j \right ]$的点时的最优决策 $\left \langle ...

  9. mysql group by order by havaing where 顺序

    结论: select xx from xx where xx group by xx order by xxx; select xx from xx group by xx having xx ord ...

  10. golang-os文件操作

    golang-os文件操作 package main import ( "fmt" "os" ) //func main() { // f,err :=os.C ...