博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Fedora 20 上安装Mysql并初始化root密码
阅读量:4624 次
发布时间:2019-06-09

本文共 4991 字,大约阅读时间需要 16 分钟。

[root@localhost ~]# yum -y install community-mysql-server #安装数据库已加载插件:langpacks, refresh-packagekitgoogle-chrome 3/3正在解决依赖关系There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).--> 正在检查事务---> 软件包 community-mysql-server.x86_64.0.5.5.35-1.fc20 将被 安装--> 正在处理依赖关系 community-mysql-common(x86-64) = 5.5.35-1.fc20,它被软件包 community-mysql-server-5.5.35-1.fc20.x86_64 需要--> 正在处理依赖关系 mysql(x86-64),它被软件包 community-mysql-server-5.5.35-1.fc20.x86_64 需要--> 正在检查事务---> 软件包 community-mysql.x86_64.0.5.5.35-1.fc20 将被 安装---> 软件包 community-mysql-common.x86_64.0.5.5.35-1.fc20 将被 安装--> 解决依赖关系完成依赖关系解决================================================================================Package 架构 版本 源 大小================================================================================正在安装:community-mysql-server x86_64 5.5.35-1.fc20 updates 8.8 M为依赖而安装:community-mysql x86_64 5.5.35-1.fc20 updates 4.9 Mcommunity-mysql-common x86_64 5.5.35-1.fc20 updates 208 k事务概要================================================================================安装 1 软件包 (+2 依赖软件包)总下载量:14 M安装大小:78 MDownloading packages:(1/3): community-mysql-5.5.35-1.fc20.x86_64.rpm | 4.9 MB 00:04 (2/3): community-mysql-common-5.5.35-1.fc20.x86_64.rpm | 208 kB 00:00 (3/3): community-mysql-server-5.5.35-1.fc20.x86_64.rpm | 8.8 MB 00:03 --------------------------------------------------------------------------------总计 1.4 MB/s | 14 MB 00:09 Running transaction checkRunning transaction testTransaction test succeededRunning transaction正在安装 : community-mysql-common-5.5.35-1.fc20.x86_64 1/3 正在安装 : community-mysql-5.5.35-1.fc20.x86_64 2/3 正在安装 : community-mysql-server-5.5.35-1.fc20.x86_64 3/3 验证中 : community-mysql-5.5.35-1.fc20.x86_64 1/3 验证中 : community-mysql-server-5.5.35-1.fc20.x86_64 2/3 验证中 : community-mysql-common-5.5.35-1.fc20.x86_64 3/3已安装:community-mysql-server.x86_64 0:5.5.35-1.fc20作为依赖被安装:community-mysql.x86_64 0:5.5.35-1.fc20 community-mysql-common.x86_64 0:5.5.35-1.fc20完毕![root@localhost ~]# systemctl start mysqld.service[root@localhost ~]# systemctl enable mysqld.serviceln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'[root@localhost ~]# mysql -u root #以root登陆数据库Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.5.35 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> select user, host, password from mysql.user; #user列表+------+-----------+----------+| user | host | password |+------+-----------+----------+| root | localhost | || root | rachel | || root | 127.0.0.1 | || root | ::1 | || | localhost | || | rachel | |+------+-----------+----------+rows in set (0.00 sec)mysql> delete from mysql.user where user=''; #删除空userQuery OK, 2 rows affected (0.00 sec)mysql> delete from mysql.user where user='root' and host='::1'; #删除IPv6用户(如果不用的话)Query OK, 1 row affected (0.00 sec)mysql> select user, host, password from mysql.user;+------+-----------+----------+| user | host | password |+------+-----------+----------+| root | localhost | || root | rachel | || root | 127.0.0.1 | |+------+-----------+----------+rows in set (0.00 sec)# 设定密码mysql> set password for root@localhost=password('XXXXXX');Query OK, 0 rows affected (0.00 sec)mysql> set password for root@rachel=password('XXXXXX');Query OK, 0 rows affected (0.00 sec)mysql> set password for root@'127.0.0.1'=password('XXXXXXX');Query OK, 0 rows affected (0.00 sec)#再次列密码mysql> select user, host, password from mysql.user;+------+-----------+-------------------------------------------+| user | host | password |+------+-----------+-------------------------------------------+| root | localhost | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX || root | rachel | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX || root | 127.0.0.1 | *C7E2F6338326EDC0AXXXXXXXXXXXXXXXXXXXXXXX |+------+-----------+-------------------------------------------+rows in set (0.00 sec)mysql> exitBye[root@localhost ~]# mysql -u root -p #再次登录Enter password: #输入刚才的密码Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.5.35 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> exitBye[root@localhost ~]#

 

转载于:https://www.cnblogs.com/Candies/p/5446114.html

你可能感兴趣的文章
20165231 实验一 Java开发环境的熟悉
查看>>
Solr学习总结(六)SolrNet的高级用法(复杂查询,分页,高亮,Facet查询)
查看>>
对象序列化和反序列化
查看>>
6.10
查看>>
lcd_1602
查看>>
贪心讲解链接
查看>>
vim:隆重推荐括号补全插件--auto-pairs
查看>>
矩阵的理解——转载
查看>>
xcode Git
查看>>
[NOI2015]软件包管理器
查看>>
uploadify上传大文件时出现404错误
查看>>
Java SE之正则表达式五:切割
查看>>
九、基础正则表达式BRE
查看>>
vue中使用自定义金额格式化组件,对金额进行千分位格式化
查看>>
STM32 printf函数
查看>>
反射获取类结构信息
查看>>
玩转JavaScript正则表达式
查看>>
hiberbnate 缓存策略概述
查看>>
python学习day25 接口类 抽象类 多态 封装
查看>>
同一场景下多个图层之间的调用
查看>>