O-Linux&Shell-W12

linux系统管理(下)

step1:安装wget命令
O-Linux&Shell-W12 linux系统管理(下)

step2: 官方下载mysql安装包

#wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

O-Linux&Shell-W12 linux系统管理(下)

step3:运行ll命令查看rpm文件的下载情况

O-Linux&Shell-W12 linux系统管理(下)

step4:安装mysql的rpm包

#rpm -ivh mysql57-community-release-el7-8.noarch.rpm

O-Linux&Shell-W12 linux系统管理(下)

step5:安装mysql的服务器

#yum -y install mysql-community-server(需要下载,可能会比较慢)

O-Linux&Shell-W12 linux系统管理(下)

step6:重启mysql的服务器,服务器名为mysqld.service

O-Linux&Shell-W12 linux系统管理(下)

step7: 查看mysql服务器的运行状态,服务名为mysqld.service

O-Linux&Shell-W12 linux系统管理(下)

step8: 使用find命令查询my.cnf文件的位置。

O-Linux&Shell-W12 linux系统管理(下)

step9:使用vi编辑my.cnf文件查询到关键字[mysqld],并在下面增加一行文字skip-grant-tables,作用为跳过密码验证。保存退出。

O-Linux&Shell-W12 linux系统管理(下)

step10:使用root用户登录mysql数据库

#mysql -u root

O-Linux&Shell-W12 linux系统管理(下)

step11:查看mysql中有哪些默认数据库

mysql>show databases;

O-Linux&Shell-W12 linux系统管理(下)

step12:进入mysql数据库

mysql>connect mysql;

O-Linux&Shell-W12 linux系统管理(下)

step13: 查看mysql数据库中有哪些表

mysql>show tables;

O-Linux&Shell-W12 linux系统管理(下)

step14:在mysql数据库中创建表test,字段u_id integer,u_name varchar(12)

O-Linux&Shell-W12 linux系统管理(下)

step15: 向test表中插入三条数据

1,liukailin

2,wanghaocun

3,sunkangkang

O-Linux&Shell-W12 linux系统管理(下)

step16:查看是否插入成功

O-Linux&Shell-W12 linux系统管理(下)

step17:退出mysql命令行

mysql>quit

O-Linux&Shell-W12 linux系统管理(下)

相关文章:

猜你喜欢
相关资源
相似解决方案