用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. axios 的 get 方法 params 传参 400 的问题

    axios 的 get 方法 params 传参,在输入框中输入某些特殊字符 例如中括号,请求时会直接报 400 错误,Bad Request. 原因:axios 的 get 方法,在使用 param ...

  2. hive函数之数学函数

    hive函数之数学函数   round(double d)--返回double型d的近似值(四舍五入),返回bigint型: round(double d,int n)--返回保留double型d的n ...

  3. 使用VISIO绘制组织结构图的操作方法

    1.确保电脑已安装VISIO软件,然后在电脑指定位置点击鼠标右键新建VISIO绘图文档. 2.打开文档,在弹出的选择绘图类型中点击商务.组织结构图,之后点击确定. 3.之后进入绘图主界面,在左侧是形状 ...

  4. Linux中修改环境变量

    <1>Linux 的变量作用范围可分为两类:环境变量和本地变量 环境变量,或者称为全局变量,存在与所有的shell 中,在你登陆系统的时候就已经有了相应的系统定义的环境变量了.Linux ...

  5. eclipse 安装反编译工具

    jd-gui是我最喜欢使用的java反编译工具.它是一款用c++开发的轻量级的java反编译工具,无须安装即可以使用,你甚至都不需要安装jre环境就可以实现反编译:支持最新的jdk,目前是jdk 1. ...

  6. Java获取视频的大小、时长

    前端上传视频之后,根据上传的视频文件获取视频的大小和时长 1.获取视频时长 private String ReadVideoTime(File source) { Encoder encoder = ...

  7. Mysql 查询阻塞和事物情况

    MYSQL 服务器逻辑架构图 连接/线程处理 == > (解析器 –> 查询缓存) ===> 优化器 ===> 存储引擎 服务器级别锁MYSQL 使用的锁类型:表锁(显式:LO ...

  8. web 字体 font-family

    body { font-family: -apple-system, //针对 Web 页面 BlinkMacSystemFont, //针对 Mac Chrome 页面 SFProDisplay, ...

  9. 如何重置Portal for ArcGIS、ArcGIS Server管理员密码

    忘记管理员密码是ArcGIS系统管理员司空见惯的情况.每次为了找回站点管理员密码,用户经常要测试多次.有没有一种快捷的解决方案呢?答案是有的. 下面将分别介绍如何重置Portal for ArcGIS ...

  10. HIVE 乱码以及 HUE SQL 语句兼容性的记录(遇到应该会一直更新)

    最近在 HUE 里面查询有中文字段相关的东西被报错警告... (1366, Incorrect string value: \\xE4\\xBA\\xAC\\xE4\\xB8\\x9C... for ...