用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. BZOJ4659: Lcm

    Description 给出A,B,考虑所有满足l<=a<=A,l<=b<=B,且不存在n>1使得n^2同时整除a和b的有序数 对(a,b),求其lcm(a,b)之和.答 ...

  2. Caused by: java.nio.charset.MalformedInputException: Input length = 1

    java.lang.IllegalStateException: Failed to load property source from location 'classpath:/applicatio ...

  3. [Wc2011] Xor 和 [HNOI2011]XOR和路径

    Xor F.A.Qs Home Discuss ProblemSet Status Ranklist Contest 入门OJ ModifyUser  autoint Logout 捐赠本站 Prob ...

  4. tomcat绑定项目classes路径

    在Host中加入如下内容: <Context path="" docBase="D:\svn\MainSource\WebRoot" debug=&quo ...

  5. HDFS的NameNode堆内存估算

    NameNode堆内存估算 在HDFS中,数据和元数据是分开存储的,数据文件被分割成若干个数据块,每一个数据块默认备份3份,然后分布式的存储在所有的DataNode上,元数据会常驻在NameNode的 ...

  6. 4.3 axios

    axios全局拦截器:

  7. Go语言 - 关于常用插件不能安装的处理办法

    解决办法 这里的是Windows的环境下的解决办法 在GOPATH的src目录下面创建github.com\golang文件夹,若文件夹存请忽略本步骤 在vs code终端执行: cd %GOPATH ...

  8. Apache Phoenix系列 | 从入门到精通(转载)

    原文地址:https://cloud.tencent.com/developer/article/1498057 来源: 云栖社区 作者: 瑾谦 By 大数据技术与架构 文章简介:Phoenix是一个 ...

  9. learning java Date类

    var d1 = new Date(); var d2 = new Date(System.currentTimeMillis() + 1000); System.out.println(d1); S ...

  10. 猴猴吃香蕉 背包DP

    猴猴吃香蕉 背包DP \(D\)次询问,第\(i\)次询问,每次有\(n_i\)个带权香蕉,问有多少方案使香蕉之积为\(k_i\),对结果取模\(1000000007\) \(n\le 10^3,k\ ...