视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
为什么win10玩cf闪退 更新mysqlroot密码忘记了怎么办 cf烟雾头怎么调win10 如何修改mysqlroot密码 烟雾头怎么调win10 word如何一次性删除全部批注 excel同时显示多个独立窗口 excel工作表保护密码忘记了怎么办 word中钢筋等级符号怎么打 微信是什么原因才会被封号呢 为什么谷歌浏览器打不开网页 微信零钱明细被删除后怎么恢复 华为手机忘了应用锁密码怎么办 ps如何将图片中添加文字 怎么才能把歌下载到u盘 mysql安装详细教程 mysql怎么设置root密码忘记了怎么办 修改MySql数据库Root密码 怎么关闭360安全浏览器的右下角广告 win10怎么设置cf烟雾头 如何把歌下到u盘里面 win10玩cf如何调全屏 ps如何在一张图中添加文字 ps怎么对图片边缘进行羽化 微信零钱明细删除过后怎么恢复 微信封号一般是什么原因 英雄联盟截图在哪里看 windows10烟雾头怎么调 怎么关闭360浏览器右下角广告 怎么修改mysqlroot密码 红帽认证rhce多少钱 mysql改root密码忘记了怎么办 mysql下载安装教程 mysql详细安装教程 如何电脑上下载歌曲到u盘 linux安装rpm命令用法 mysqlroot密码忘记了怎么办 微信封号的原因是什么 如何修改mysql数据库root密码 mysql怎么修改root密码
最新文章专题视频专题关键字专题TAG最新视频文章视频文章2视频2tag2tag3文章专题问答问答2 文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3

mysql安装使用教程

产品型号:Thinkpad E15

系统版本:centos7

软件版本:mysql 5.7

mysql安装教程

1.使用yum安装mysql数据库的软件包 

[root@xuegod63 ~]# yum -y install mariadb-server mariadb 

注:  

mariadb-server  #MariaDB数据库 

mariadb      # MariaDB服务器Linux下客户端 

注:从centos7系统开始,系统中自带的mysql数据库变成了mariadb-server,mariadb-server和mysql操作上一样。mariadb-server是mysql的一个分支。

2.启动数据库服务

[root@xuegod63 ~]# systemctl start  mariadb #启动MariaDB服务

[root@xuegod63 ~]# systemctl enable  mariadb #设置开启自动启动MariaDB服务

3. 安装完mariadb-server后,运行mysql_secure_installation去除安全隐患

[root@xuegod63 ~]# mysql_secure_installation #进入安全配置导向

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 current

password for the root user. If you've just installed MySQL, and

you 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):  #初次运行直接回车,因为root用户没有密码

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] Y #是否设置root用户密码,输入Y

New password: 123456  #新密码123456

Re-enter new password: 123456

Password updated successfully!

。。。

Remove anonymous users? [Y/n] Y  #是否删除匿名用户,生产环境建议删除,所以直接回车或Y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y #是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止

 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] Y  #是否删除test数据库,直接回车或Y

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!

Reloading the privilege tables will ensure that all changes made so far

will 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 MariaDB

installation should now be secure.

Thanks for using MariaDB!

… Success!

至此数据库安装成功。

4. 登录数据库

[root@xuegod63 ~]# mysql -u root -p123456 

MariaDB [(none)]> show databases;    #没有test数据库 #执行时,所有命令以;号结尾 

+-------------------------+ 

| Database

+-------------------------+ 

| information_schema

| mysql

| ucenter

+-------------------------+ 

3 rows in set (0.00 sec) 

MariaDB [(none)]> exit #退出命令可以加分号,也可以不加分号。

总结:

1、使用yum安装mysql数据库的软件包 

2、启动数据库服务

3、运行mysql_secure_installation去除安全隐患

4、登录数据库

使用 安装 使用教程
专题软文怎么发软文怎么发专题如何写软文如何写软文专题活动软文怎么写活动软文怎么写专题rhca培训多少钱rhca培训多少钱专题rhcsa培训多少钱rhcsa培训多少钱专题linux分区方法linux分区方法专题linux磁盘分区方法linux磁盘分区方法专题apache安装方法apache安装方法专题apache和nginx的区别apache和nginx的区别专题docker命令教程docker命令教程专题 linux安装nginx方法 linux安装nginx方法专题nginx反向代理配置nginx反向代理配置专题nginx负载均衡策略nginx负载均衡策略专题nginx负载均衡配置nginx负载均衡配置专题nginx配置文件详解nginx配置文件详解专题nginx是什么nginx是什么专题nginx重启方法nginx重启方法专题安装docker步骤安装docker步骤专题安装docker教程安装docker教程专题docker进入容器的命令docker进入容器的命令专题docker镜像制作方法docker镜像制作方法专题docker删除镜像的方法docker删除镜像的方法专题docker删除容器的方法docker删除容器的方法专题启动docker命令启动docker命令专题重启docker的方法重启docker的方法专题怎么使用vlookup函数匹配怎么使用vlookup函数匹配专题喜马拉雅下载的音频怎么变成mp3喜马拉雅下载的音频怎么变成mp3专题微博点赞后取消对方知道吗微博点赞后取消对方知道吗专题手机连不上wifi怎么办手机连不上wifi怎么办专题什么叫软文什么叫软文专题mysql的配置参数专题mysql说明文档专题mysql调优方法专题mysql 连接池设置专题mysql备份方案说明专题mysql数据库运维优化方案专题mysql 迁移方案专题docker 如何下载mysql专题mysql数据实时同步方法专题mysql同步方案专题mysql迁移方案专题mysql 学习步骤专题设置mysql连接数专题mysql连接数设置专题mysql推荐配置专题mysql学习步骤专题mysql用户设置专题mysql分表方法专题mysql配置文档专题mysql热备份步骤专题