1.安装 Mysql Server

# yum install mysql mysql-server

可以到mysql官网去下载,我下载的是通用版本。你需要下载下面四个文件就可以了。

mysql-client --------客户端包

mysql-server --------主服务器包

mysql-devel ---------开发包,作为开发者,这个是必须的,其提供开发用的头文件和库文件

mysql-shared ----共享组建包-----外部客户端使用的共享库

然后安装就可以了


2.开启 MySQL server 及开机启动 MySQL

# systemctl start mysqld.service
# systemctl enable mysqld.service
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'

或者使用:

# sudo chkconfig --levels 235 mysqld on

注意:正在将请求转发到“systemctl enable mysqld.service”。


3.MySQL Secure Installation

# /usr/bin/mysql_secure_installation

通过操作将进行以下各项过程

  • Set (Change) root password

  • Remove anonymous users

  • Disallow root login remotely

  • Remove test database and access to it

  • Reload privilege tables output:

$ sudo /usr/bin/mysql_secure_installation
[sudo] password for tiny:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the currentpassword for the root user. If you've just installed MySQL, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQLroot user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.Change the root password? [Y/n] n
... skipping.
By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.
Remove test database and access to it? [Y/n] y
-Dropping test database...
... Success!
- Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...All done!
If you've completed all of the above steps, your MySQLinstallation should now be secure.
Thanks for using MySQL!

或者对于本地测试环境直接可以使用以下命令来初始化root密码:

# mysqladmin -u root password [your_password_here]

4.本地连接 Mysql

$ mysql -u root -p$ mysql -h localhost -u root -p

5.创建数据库,创建新用户及授予权限

## 创建数据库 flaskr ##

mysql> CREATE DATABASE flaskr;

## 创建用户 flaskr_user ##

mysql> CREATE USER 'flaskr_user'@'192.168.1.102' IDENTIFIED BY 'passwordxxx';

## 授予权限 ##

mysql> GRANT ALL ON flaskr.* TO 'flaskr_user'@'192.168.1.102';

## FLUSH PRIVILEGES, reload the GRANT TABLES ##

mysql> FLUSH PRIVILEGES;
 
 

本文出自 “成鹏致远” 博客,请务必保留此出处http://infohacker.blog.51cto.com/6751239/1154967

【Mysql】Fedora下 Mysql 安装及配置的更多相关文章

  1. win10下MYSQL的下载、安装以及配置超详解教程(转)

    下载MYSQL 官网下载MYSQL5.7.21版本,链接地址https://www.mysql.com/downloads/.下载流程图如下: 进入官网点击Community,下载社区版. 找到MYS ...

  2. CentOS 下 redis 安装与配置

    CentOS 下 redis 安装与配置   1.到官网上找到合适版本下载解压安装 [root@java src]# wget -c http://redis.googlecode.com/files ...

  3. [转]:Ubuntu 下Apache安装和配置

    [转]:Ubuntu 下Apache安装和配置_服务器应用_Linux公社-Linux系统门户网站  https://www.linuxidc.com/Linux/2013-06/85827.htm ...

  4. libCURL开源库在VS2010环境下编译安装,配置详解

    libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 http://blog.csdn.net/su ...

  5. Debian 8下vsftpd安装与配置

    Debian 8下vsftpd安装与配置 0.环境 root@remote:/# uname -r 3.16.0-4-amd64 root@remote:/e# lsb_release No LSB ...

  6. Windows下pry安装和配置

    Windows下pry安装和配置 pry是一个增强型的交互式命令行工具,比irb强大. 有自动完成功能,自动缩进,有颜色.有更强大的调试功能. pry 安装很简单. 在终端输入: gem instal ...

  7. [moka同学摘录]在Centos 6.5下成功安装和配置了vim7.4

    来源:https://my.oschina.net/gzyh/blog/266097 资源下载地址: 链接:http://pan.baidu.com/s/1kVuaV5P 密码:xkq9   摘要: ...

  8. Windows Server 2003 下如何安装及配置 FTP 服务器(转)

    Windows Server 2003 下如何安装及配置 FTP 服务器 一.安装 FTP 服务器组件: 写在这里的一点 : 安装及配置 FTP 服务器之前 , 必须先手工配置服务器本身的 IP 地址 ...

  9. redis 在Linux下的安装与配置

    redis在Linux下的安装与配置 by:授客  QQ:1033553122 测试环境 redis-3.0.7.tar.gz 下载地址: http://redis.io/download http: ...

  10. windows下redis安装和配置

    windows下redis安装和配置 redis介绍 Redis是一个开源,高级的键值存储和一个适用的解决方案,用于构建高性能,可扩展的Web应用程序. Redis有三个主要特点,使它优越于其它键值数 ...

随机推荐

  1. Swift 导航栏设置图片点击事件,图片蓝色的解决方案

    如果导航栏想做一个点击事件,正好是一个图片 我们可以直接这样: self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIIm ...

  2. iOS 适用于Pad上的菜单弹出界面-最简单的一种实现记录

    前言: 此种方式实现只适用于pad开发,在iPhone上是无效的. 实现: 比如我在界面上有一个按钮,点击按钮,在按钮旁边弹出一个Pop框. 1.按钮点击事件 btn.addTarget(self, ...

  3. hibernate注解note

    @Id标识主键属性 1.hibernate5.2 mysql5.7 不需要实现 serializable也可以? 2.主键255的长度我生成了? @GeneratedValue主键生成策略 1.主键设 ...

  4. 树莓派进阶之路 (005) - 树莓派Zsh安装脚本(原创)

    zsh.sh #!/bin/bash cd #安装zsh sudo apt-get install zsh #查看zsh cat /etc/shells #更改zsh chsh -s /bin/zsh ...

  5. TCP/IP 详解7 Ping指令

    首先介绍一下ping 指令的基本过程:(这部分摘自网络) 我们以下面一个网络为例:有A.B.C.D四台机子,一台路由RA,子网掩码均为255.255.255.0,默认路由为192.168.0.1 1. ...

  6. 最烂编程语言得主:javascript

    C++在我脑中一直是一门缺乏设计和远见的语言,其设计者也是缺少主见的人(我承认我对c++有一定偏见),在我看来,C++从一开始就是堆叠语言特性,成为最流行的语言,,只是这个时代将它推到了最前列,我心中 ...

  7. POJ 2115:C Looooops

    C Looooops Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19536   Accepted: 5204 Descr ...

  8. Mysql:MyIsam和InnoDB的区别

    MyISAM: 这个是默认类型,它是基于传统的ISAM类型,ISAM是Indexed Sequential Access Method (有索引的 顺序访问方法) 的缩写,它是存储记录和文件的标准方法 ...

  9. 利用sdkman安装kotlin和java环境

    如果想在命令行下面运行kotlin程序,最省事的办法就是用sdkman来安装了: 1.安装sdkman: curl -s "https://get.sdkman.io" | bas ...

  10. asp.net core中使用log4net

    和之前的ASP.NET MVC中的使用LOG4NET的方法有些不同,这里先记录一下,使用步骤如下 : 1. 建立 ASP.NET CORE项目中,NUGET中搜索log4net后下载安装 2. 根目录 ...