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. For循环中不可以嵌套RDD操作

    今天犯了一个致命理解错误,Spark中的RDD Map操作只是一个计算式的传递,并不是Action,也就是在for循环中不会产生真正的计算. 因此,如果for循环中出现了RDD的Map类似操作,都会引 ...

  2. 热安装NGINX并支持多站点SSL

    https://www.moonfly.net/801.html http://www.centoscn.com/image-text/config/2015/0423/5251.html 1.查看n ...

  3. Spring ClassPathXmlApplicationContext和FileSystemXmlApplicationContext

    先说:ClassPathXmlApplicationContext 这个类,默认获取的是WEB-INF/classes/下的路径,也就是在myeclipse的src下的路径,所以用这个是获取不到WEB ...

  4. mySQL的存储过程详解

    mysql存储过程详解 1.      存储过程简介   我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成特定功能的S ...

  5. AC日记——平衡树练习 codevs 4244

    4244 平衡树练习 思路: 有节操的人不用set也不用map: 代码: #include <cstdio> #include <cstring> #include <i ...

  6. AC日记——[SCOI2012]喵星球上的点名 bzoj 2754

    2754 思路: AC自动机暴力处理匹配: 强大的ac自动机,强大的fail树,强大的map,强大的vector,强大的指针: 代码: #include <map> #include &l ...

  7. 蓝牙遥控小车设计(四)——Android APP遥控

    最近都没心情写博客,忙着答辩论文之类的,唉,主要是愁工作啊...... 先上车体全景图: APP截图: 上最终视频:

  8. 【转】docker之Dockerfile实践

    转自:https://www.cnblogs.com/jsonhc/p/7767669.html 上一篇介绍了Dockerfile中使用的指令,现在开始进行指令实践 先查看下本地的镜像,选一个作为ba ...

  9. rsync用于同步目录

    rsync是unix/linux下同步文件的一个高效算法,它能同步更新两处计算机的文件与目录,并适当利用查找文件中的不同块以减少数据传输.rsync中一项与其他大部分类似程序或协定中所未见的重要特性是 ...

  10. notepad++ 删除重复记录

    sort line with Edit -> Line Operations -> Sort Lines Lexicographically ascending do a Find / R ...