Centos:mysql的安装和使用:yum方式
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方式的更多相关文章
- centos mysql 编译安装
centos mysql 编译安装 1.安装 创建MySQL用户 sudo useradd mysql 下载MySQL的源码包,我们这里使用的时5.5.18 安装依赖 sudo yum -y inst ...
- 重要参考文档---MySQL 8.0.29 使用yum方式安装,开启navicat远程连接,搭建主从,读写分离(需要使用到ProxySQL,此文不讲述这个)
yum方式安装 echo "删除系统默认或之前可能安装的其他版本的 mysql" for i in $(rpm -qa|grep mysql);do rpm -e $i --nod ...
- CentOS7下常用安装服务软件yum方式的介绍
简介:介绍yum软件包的管理并配置本地yum源 yum安装:基于 C/S 架构,yum安装称之为傻瓜式安装 yum安装优点:方便快捷,不用考虑包依赖,自动下载软件包. yum安装缺点:人为无法干预,无 ...
- Centos 7 手把手教你使用YUM方式安装并配置Nginx+php7-fpm+MySQL
需要准备的内容 一台纯净系统的服务器 远程连接服务器的工具 (我这里使用Xshell) 安装nginx 链接上服务器后执行 yum install nginx 这里需要输入y 后回车,开始安装ngi ...
- CentOS虚拟机不能联网状况下yum方式从本地安装软件包(转载的)
大家都知道yum是linux下一个非常好用的软件安装/卸载软件,它方便操作,而且最厉害的是可以解决令人头疼的包依赖关系.但是若是你的linux不能联网,若想使用yum安装软件,可以依照下面的方法. 1 ...
- CentOS虚拟机不能联网状况下yum方式从本地安装软件包
大家都知道yum是linux下一个非常好用的软件安装/卸载软件,它方便操作,而且最厉害的是可以解决令人头疼的包依赖关系.但是若是你的linux不能联网,若想使用yum安装软件,可以依照下面的方法. 1 ...
- linux(centos6.8 64位)下安装mysql5.7(yum方式)
下载mysql源安装包 # wget http:.noarch.rpm 安装mysql源包 #yum localinstall mysql57.noarch.rpm 检查mysql源是否安装成功 # ...
- Centos6安装MySQL5.7(yum方式)
1. 下载并安装用来配置mysql的yum源的rpm包 # 下载 wget http://repo.mysql.com/mysql57-community-release-el6-10.noarch. ...
- 在CentOS 7上安装常用的YUM源
参考地址:https://blog.csdn.net/u010048823/article/details/51298183 以epel源为例子,来讲解如何添加额外的YUM源. Extra Packa ...
- 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 ...
随机推荐
- 【洛谷 P1631】 序列合并 (堆)
题目链接 直接暴力搞是\(n\)方的复杂度.\(n^2\)个数选\(n\)个最小的,容易想到堆. 我们堆里记录两个信息:到\(A\)数组哪个位置了,到\(B\)数组哪个位置了, 我直接把这两个信息存在 ...
- dd命令测试硬盘I/O速度
[root@bogon ~]# dd if=/dev/zero of=/home/tom.a.txt bs=200MB count=1记录了1+0 的读入记录了1+0 的写出200000000字节(2 ...
- linux驱动基础系列--linux spi驱动框架分析(续)
前言 这篇文章是对linux驱动基础系列--linux spi驱动框架分析的补充,主要是添加了最新的linux内核里设备树相关内容. spi设备树相关信息 如之前的文章里所述,控制器的device和s ...
- V-Hyper安装ubuntu-13.10-server-amd64
1.在windws8上的V_Hyper虚拟机上安装Ubuntu虚拟机服务器版.遇到的问题和解决方案 2.正确的在V-Hyper配置方法参考文章:在Hyper-V中安装和配置Ubuntu Server ...
- 查找(二分、hash、桶)
先上一个最简单的题 1230 元素查找 给出n个正整数,然后有m个询问,每个询问一个整数,询问该整数是否在n个正整数中出现过. 输入描述 Input Description 第一行两个整数 n 和m. ...
- python中的with与上下文管理器
#转载请留言联系 很多人平时需要打开文件进行读取写入操作时,通常这样: f = open('文件路径','w') f.write(data) f.close 这样写有一个潜在的问题,如果在调用 wri ...
- React Native - 2 控件Flexbox
*强烈建议使用Genymotion模拟器,比AVD速度快,功能强大. 1. flexDirection Flexbox是连续布局,它有主轴(primary axis)和交叉轴(cross axis ...
- Rescue The Princess
Description Several days ago, a beast caught a beautiful princess and the princess was put in prison ...
- Mathematica作图
第2讲 在Mathematica中作图 一个较强的符号计算系统均有很好的绘图功能,Mathematica也不例外,Mathematica 拥有非常强大的绘图功能.并且提供了一大批基本数学函数的图 ...
- thinkphp函数学习(0)——开篇
因为新公司都使用thinkphp,所以就想通读一遍源码,可是在读的过程中,时常半路杀出个自定义函数,然后又要跳到函数定义的地方先看具体的函数定义,感觉特别的难受,好几次都是看到runtime.php就 ...