1、安装:

安装客户端

sudo yum install mysql

安装服务器

sudo yum install mysql-server

2、配置:查看配置文件

cat /etc/my.cnf

3、启动:

启动脚本:cat /etc/init.d/mysqld

sudo service mysqld start/stop/status/restart/reload/force-reload/condrestart

初次启动信息:多了启动初始化的一些工作

Initializing MySQL database:  WARNING: The host '10-57-19-59' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
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 10-57-19-59 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  ]

未初始化前,mysql -h127.0.0.1 -uroot登录后的表如下,root账号都默认密码为空

执行如下命令进行安装设置:

sudo mysql_secure_installation

设置root密码,禁止远程用户使用root账号登录,删除测试表test,删除匿名用户,重新设置表的权限

重新设置密码:password 'root'为新密码;-proot为旧密码

sudo mysqladmin -u root -h127.0.0.1  -proot  password 'root'

把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。

mysql> grant all privileges on *.* to root@'%' identified by 'password';

如果是新用户而不是root,则要先新建用户

mysql>create user 'username'@'%' identified by 'password';  

此时就可以进行远程连接了。

Centos:mysql的安装和使用:yum方式的更多相关文章

  1. centos mysql 编译安装

    centos mysql 编译安装 1.安装 创建MySQL用户 sudo useradd mysql 下载MySQL的源码包,我们这里使用的时5.5.18 安装依赖 sudo yum -y inst ...

  2. 重要参考文档---MySQL 8.0.29 使用yum方式安装,开启navicat远程连接,搭建主从,读写分离(需要使用到ProxySQL,此文不讲述这个)

    yum方式安装 echo "删除系统默认或之前可能安装的其他版本的 mysql" for i in $(rpm -qa|grep mysql);do rpm -e $i --nod ...

  3. CentOS7下常用安装服务软件yum方式的介绍

    简介:介绍yum软件包的管理并配置本地yum源 yum安装:基于 C/S 架构,yum安装称之为傻瓜式安装 yum安装优点:方便快捷,不用考虑包依赖,自动下载软件包. yum安装缺点:人为无法干预,无 ...

  4. Centos 7 手把手教你使用YUM方式安装并配置Nginx+php7-fpm+MySQL

    需要准备的内容 一台纯净系统的服务器 远程连接服务器的工具 (我这里使用Xshell) 安装nginx 链接上服务器后执行 yum install nginx  这里需要输入y 后回车,开始安装ngi ...

  5. CentOS虚拟机不能联网状况下yum方式从本地安装软件包(转载的)

    大家都知道yum是linux下一个非常好用的软件安装/卸载软件,它方便操作,而且最厉害的是可以解决令人头疼的包依赖关系.但是若是你的linux不能联网,若想使用yum安装软件,可以依照下面的方法. 1 ...

  6. CentOS虚拟机不能联网状况下yum方式从本地安装软件包

    大家都知道yum是linux下一个非常好用的软件安装/卸载软件,它方便操作,而且最厉害的是可以解决令人头疼的包依赖关系.但是若是你的linux不能联网,若想使用yum安装软件,可以依照下面的方法. 1 ...

  7. linux(centos6.8 64位)下安装mysql5.7(yum方式)

    下载mysql源安装包 # wget http:.noarch.rpm 安装mysql源包 #yum localinstall mysql57.noarch.rpm 检查mysql源是否安装成功 # ...

  8. Centos6安装MySQL5.7(yum方式)

    1. 下载并安装用来配置mysql的yum源的rpm包 # 下载 wget http://repo.mysql.com/mysql57-community-release-el6-10.noarch. ...

  9. 在CentOS 7上安装常用的YUM源

    参考地址:https://blog.csdn.net/u010048823/article/details/51298183 以epel源为例子,来讲解如何添加额外的YUM源. Extra Packa ...

  10. CentOS 5.8 安装python 和 yum

    centos 5.8  资源路径: http://vault.centos.org/5.8/os/x86_64/CentOS/ rpm -Uvh http://vault.centos.org/5.8 ...

随机推荐

  1. bzoj 2245 费用流

    比较裸 源点连人,每个人连自己的工作,工作连汇,然后因为人的费用是 分度的,且是随工作数非降的,所以我们拆边,源点连到每个人s+1条边 容量是每段的件数,费用是愤怒 /**************** ...

  2. 填坑webpack

    1.Concepts: webpack is a module bundler for modern JS applications. Since there are lots of complex ...

  3. django2.0的reverse

    导入: 官方文档地址:https://yiyibooks.cn/xx/Django_1.11.6/topics/http/urls.html from django.urls import rever ...

  4. python3 生成器表达式

    生成器表达式 [i for i in range(100)] #列表解析 与列表解析的不同是,列表解析用中括号,生成器表达式用小括号 g = (i for i in range(1000)) #生成器 ...

  5. unicode字符串解码显示

    # encoding: utf-8 ''' unicode字符串解码显示 ''' import sys reload(sys) sys.setdefaultencoding('utf-8') a = ...

  6. 苹果Swift可为Windows/Android开发软件了

    http://www.swifthumb.com/article-189-1.html http://iphone.tgbus.com/news/class/201502/20150211103418 ...

  7. 【反演复习计划】【bzoj3994】DZY loves maths

    这题大概就是提取一下d,然后就跟前面的题目差不多了. #include<bits/stdc++.h> #define N 10000005 using namespace std; typ ...

  8. yii2框架获取刚插入数据库的id (原创)

    $insert_id = $UserModel->attributes['id'];

  9. SyntaxError: Non-ASCII character '\xe7' in file 错误的解决方法

    在代码开头写下面的定义即可 #encoding:utf-8

  10. 洛谷——P1405 苦恼的小明

    P1405 苦恼的小明 题目描述 黄小明和他的合伙人想要创办一所英语培训机构,注册的时候要填一张个人情况的表格,在身高一栏小明犯了愁. 身高要求精确到厘米,但小明实在太高了,无法在纸上填下这么长的数字 ...