mysql安装教程(Thinkpad E15系统)

作者:百科火  更新 :2022-03-13 13:27:16   科技百科  

最佳答案mysql安装需要先使用yum安装mysql数据库的软件包 ;然后启动数据库服务并运行mysql_secure_installation去除安全隐患,最后登录数据库,便可完成安装。

mysql安装教程(Thinkpad E15系统)

产品规格: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、登陆数据库

- END -

女字加一笔是什么字?

女字加一笔是什么字?

01毋女字加一笔是毋。形象兼会意字,女之分化字。从女,正中间加一横笔为分化标记,女亦声。女、母、毋均一字之分化。东...

oa是什么意思(简略回应OA是办公自动化(Office Automation)

oa是什么意思(简略回应OA是办公自动化(Office Automation)

简略回应OA是办公自动化(Office Automation)的通称,是将电子计算机、通讯等智能化技术性应用到传统式办公方法,从而产...

两个凡是指什么内容

两个凡是指什么内容

两个凡是指什么内容,两个凡是指凡是毛主席做出的决策,我们都坚决维护;凡是毛主席的指示,我们都始终不渝地遵循。两个凡...

四棱柱的定义(四棱柱,又称四角柱,是指底部为四边形的柱)

四棱柱的定义(四棱柱,又称四角柱,是指底部为四边形的柱)

四棱柱的定义,四棱柱又称四角柱,是指底面为四边形的柱体,当底面为正方形时可成为正六面体。所有四角柱都有6个面8个顶...

蜗牛的家在哪里

蜗牛的家在哪里

蜗牛的家在哪里,蜗牛主要生活在森林、灌木、果园、菜园、农田、公园、庭院、寺庙、高山、平地以及丘陵等一些比较阴...

隶属于上海市青浦区的什么古镇

隶属于上海市青浦区的什么古镇

隶属于上海市青浦区的什么古镇,隶属于上海市青浦区的是朱家角古镇,朱家角古镇是江南水乡古镇,有着“上海威尼斯”的美...

老舍的《茶馆》主要讲了什么

老舍的《茶馆》主要讲了什么

话剧《茶馆》是著名作家老舍先生创作的一部不朽的名著,三幕话剧剧本,1957年完成...

纯碱的用途

纯碱的用途

纯碱是碳酸钠,也就是我们常说的苏打,它是一种重要的化工原料,从外形看它是一种白色粉沫,用高温水可以分解,它的液体呈碱...

掌中宝是什么位置

掌中宝是什么位置

掌中宝原本是指鸡爪中间鼓起来的部分,不过现在很多地方也把鸡脆骨统称为掌中宝。掌中宝是鸡的大腿中间那一块软骨那...

22041216c是小米什么型号

22041216c是小米什么型号

22041216c是Redmi Note 12型号手机。红米Note 12 Pro是红于2022年10月27日发布的手机产品,于2022年10月31日正式上...

查看更多知识百科