在Fedora 20 上安装Mysql并初始化root密码
[root@localhost ~]# yum -y install community-mysql-server #安装数据库 已加载插件:langpacks, refresh-packagekit
google-chrome /
正在解决依赖关系
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-.fc20 将被 安装
--> 正在处理依赖关系 community-mysql-common(x86-) = 5.5.-.fc20,它被软件包 community-mysql-server-5.5.-.fc20.x86_64 需要
--> 正在处理依赖关系 mysql(x86-),它被软件包 community-mysql-server-5.5.-.fc20.x86_64 需要
--> 正在检查事务
---> 软件包 community-mysql.x86_64.0.5.5.35-.fc20 将被 安装
---> 软件包 community-mysql-common.x86_64.0.5.5.35-.fc20 将被 安装
--> 解决依赖关系完成 依赖关系解决 ================================================================================
Package 架构 版本 源 大小
================================================================================
正在安装:
community-mysql-server x86_64 5.5.-.fc20 updates 8.8 M
为依赖而安装:
community-mysql x86_64 5.5.-.fc20 updates 4.9 M
community-mysql-common x86_64 5.5.-.fc20 updates k 事务概要
================================================================================
安装 软件包 (+ 依赖软件包) 总下载量: M
安装大小: M
Downloading packages:
(/): community-mysql-5.5.-.fc20.x86_64.rpm | 4.9 MB :
(/): community-mysql-common-5.5.-.fc20.x86_64.rpm | kB :
(/): community-mysql-server-5.5.-.fc20.x86_64.rpm | 8.8 MB :
--------------------------------------------------------------------------------
总计 1.4 MB/s | MB :
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : community-mysql-common-5.5.-.fc20.x86_64 /
正在安装 : community-mysql-5.5.-.fc20.x86_64 /
正在安装 : community-mysql-server-5.5.-.fc20.x86_64 /
验证中 : community-mysql-5.5.-.fc20.x86_64 /
验证中 : community-mysql-server-5.5.-.fc20.x86_64 /
验证中 : community-mysql-common-5.5.-.fc20.x86_64 / 已安装:
community-mysql-server.x86_64 :5.5.-.fc20 作为依赖被安装:
community-mysql.x86_64 :5.5.-.fc20
community-mysql-common.x86_64 :5.5.-.fc20 完毕!
[root@localhost ~]# systemctl start mysqld.service
[root@localhost ~]# systemctl enable mysqld.service
ln -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
Server version: 5.5. MySQL Community Server (GPL) 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> select user, host, password from mysql.user; #user列表
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | localhost | |
| root | rachel | |
| root | 127.0.0.1 | |
| root | :: | |
| | localhost | |
| | rachel | |
+------+-----------+----------+
rows in set (0.00 sec) mysql> delete from mysql.user where user=''; #删除空user
Query OK, rows affected (0.00 sec) mysql> delete from mysql.user where user='root' and host='::1'; #删除IPv6用户(如果不用的话)
Query OK, 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, rows affected (0.00 sec) mysql> set password for root@rachel=password('XXXXXX');
Query OK, rows affected (0.00 sec) mysql> set password for root@'127.0.0.1'=password('XXXXXXX');
Query OK, 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> exit
Bye
[root@localhost ~]# mysql -u root -p #再次登录
Enter password: #输入刚才的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5. MySQL Community Server (GPL) 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> exit
Bye
[root@localhost ~]#
在Fedora 20 上安装Mysql并初始化root密码的更多相关文章
- 阿里云ecs Linux下安装MySQL后设置root密码 【转】
		
方法一:最简单的方法,也是安装完mysql后,系统提示的方法.使用mysqladmin来完成.shell> mysqladmin -u root password "newpwd&qu ...
 - MacOs安装mysql与修改root密码
		
1.下载安装包 http://www.mysql.com/downloads/ 找到如下内容下载 mysql-5.7.21-1-macos10.13-x86_64.dmg下载地址是 https://c ...
 - 记录下 rhel 7 安装MySQL 并重置root密码
		
注意官方是很不提倡用root的. 下载并安装MySQL 最新的rpm地址 https://dev.mysql.com/downloads/repo/yum/ #wget https://repo.my ...
 - Ubuntu 20.04上安装MySQL教程,ubuntu安装mysql
		
在Ubuntu 20.04上安装MySQL教程 先决条件 确保您以具有sudo特权的用户身份登录. 在Ubuntu上安装MySQL 在撰写本文时,Ubuntu存储库中可用的MySQL的最新版本是MyS ...
 - 在Windows上安装MySQL(免安装ZIP版)
		
在 Windows 上安装MySQL(免安装ZIP版) 因为一些原因,重新安装了MySQL数据库,重装时习惯性使用最新版下载 此过程中发现MySQL 5.7.12 和MySQL 5.6的安装有些区别: ...
 - 记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb
		
记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb 前段时间我个人Google服务器意外不能用,并且我犯了一件很低级的错误,直接在gcp讲服 ...
 - Windows 上安装 MySQL(8.0.11)
		
1.接下来我们需要配置下 MySQL 的配置文件 打开刚刚解压的文件夹 C:\web\mysql-8.0.11 ,在该文件夹下创建 my.ini 配置文件,编辑 my.ini 配置以下基本信息: [m ...
 - 在Linux机器上安装MySQL
		
在Linux机器上安装MySQL,仔细认真些就没有问题. CentOS 7下MySQL 5.7安装.配置与应用_数据库技术_Linux公社-Linux系统门户网站 搞不定的话,直接删掉这个MySQL, ...
 - Ubuntu 12.04上安装MySQL并运行
		
Ubuntu 12.04上安装MySQL并运行 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 安装MySQL数据库 sudo apt-get upda ...
 
随机推荐
- 分页探究--Filter+JSTL
			
最近卡了一个功能就是分页,查了很多资料,分页大概是两种类型:一种是把数据库的东西全部查出来然后放在session里,用list一页一页传到页面,这样的消耗比较大;另一种就是使用sql语句的limit来 ...
 - Unity State Machine
			
https://unity3d.com/learn/tutorials/modules/beginner/5-pre-order-beta/state-machine-behaviours http: ...
 - Object.prototype.toString.call() 区分对象类型
			
判断一个对象的类型: /** * 判断对象是否为数组 * @param {Object} source 待判断的对象 * @return {Boolean} true|false */ Object. ...
 - ecshop变量介绍
			
获得商品的信息,get_goods_info($goods_id) 获取前10销量排名,get_top10()
 - Latex论文写作-Texsdudio 快捷键总结
			
Latex论文写作-Texsdudio 快捷键总结 The keyboard shortcuts can be modified at Options -> Shortcuts. The fo ...
 - LeetCode —— Merge k Sorted Lists
			
/* ** 算法的思路: ** 1.将k个链表的首元素进行建堆 ** 2.从堆中取出最小的元素,放到链表中 ** 3.如果取出元素的有后续的元素,则放入堆中,若没有则转步骤2,直到堆为空 */ #in ...
 - osharp3 操作日志之数据日志 控制增强
			
osharp3 原来的数据日志,有配置文件中有这总开关,DataLoggingEnabled,原来的程序是,这个总开关关了,就无法记录数据日志了,,如果开了,,他不管记录不记录数据日志,系统都会存数据 ...
 - 如何配置pl/sql (本地客户端)连接远程oracle服务器
			
配置方法: 1.找到oracle的安装目录.如:C:\oracle\product\10.2.0\db_1\network\ADMIN 2.找到tnsnames.ora文件. 3.用文本方式打开,添加 ...
 - apt-get 与 yum的区别 (转)
			
一般来说著名的linux系统基本上分两大类:1.RedHat系列:Redhat.Centos.Fedora等2.Debian系列:Debian.Ubuntu等 RedHat 系列 1 常见的安装包格式 ...
 - spring InitializingBean接口
			
最近工作需要得到sping中的每个事物需要执行的sql,称机会简单研究了一下spring的事务,项目中管理事务比较简单,用TransactionTemplate,就直接以TransactionTemp ...