Linux Ubuntu安装MySQL期间出现的问题总结

作为刚开始使用LIUNX环境的菜鸟,再摸爬滚打了两个晚上的学习时间后,终于在其他前辈的文章里找到了我出现问题的解决办法。

在安装的MySQL前,我尝试直接下载了搜狗输入法,但是却没有成功安装,导致了后续的一系列问题。

安装MySQL的服务端,核心程序的命令报错。

[root@master:~]  systemctl start mariadb.service
Failed to start mariadb.service:Unit mariadb.service not found.

然后我以为是MySQL的服务没有安装,然后又尝试了安装服务的命令:sudo apt-get install mysql-server,结果继续报错

[root@master:~]  sudo apt-get install mysql-server
E: Could not get lock /var/lib/dkpg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dkpg fountend lock (/var/lib/dkpg/lock-frontend), is another process using it?

然后我开始百度“E: Unable to acquire the dkpg fountend lock (/var/lib/dkpg/lock-frontend), is another process using it?

这个前辈的博客(传送站)里说到了“在ubuntu系统的termial下,用apt-get install安装软件的时候,如果在未完成下载的情况下将终端关闭。此时apt-get进程可能没有结束结果,如果再次运行apt-get install命令安装软件时,出现如上错误。即有另一个程序正在占用apt-get install进程,由于它在运行时,会占用软件源更新时的系统锁(简称'系统更新锁'),此时资源被锁。
然后我就试了他说的第一种方法,但是并没有找到被占用的进程,然后尝试第二种方法的第一个命令:

sudo rm / var / cache / apt / archives / lock,然后残忍的报错了!

[root@master:~] sudo rm/var/cache/apt/archives/lock
sudo: rm/var/cache/apt/archives/lock: command not found

 

然后默默继续百度命令未找到,然后在另外一个前辈的博客(传送站)里发现,我原来是没有设置PATH〜!

然后很怂的直接用了他的命令(现在还不知道这个命令的含义,会弄清楚的!),等待输入下一个命令了,说明问题解决了

[root@master:~] export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@master:~]

然后我尝试了先安装的MySQL的客户端

[root@master:~] sudo apt-get install mysql-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 mysql-client-5.7 mysql-client-core-5.7 mysql-common
The following NEW packages will be installed:
  libaio1 mysql-client mysql-client-5.7 mysql-client-core-5.7 mysql-common
0 upgraded, 5 newly installed, 0 to remove and 73 not upgraded.
Need to get 9,360 kB of archives.
After this operation, 64.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 libaio1 amd64 0.3.111-1
  Temporary failure resolving 'us.archive.ubuntu.com'
Ign:2 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-core-5.7 amd64 5.7.24-0ubuntu0.18.10.1
Get:3 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 mysql-common all 5.8+1.0.4 [7,308 B]
Get:2 http://security.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-core-5.7 amd64 5.7.24-0ubuntu0.18.10.1 [7,034 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-5.7 amd64 5.7.24-0ubuntu0.18.10.1 [2,302 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-5.7 amd64 5.7.24-0ubuntu0.18.10.1 [2,302 kB]
Get:2 http://security.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-core-5.7 amd64 5.7.24-0ubuntu0.18.10.1 [7,034 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client-5.7 amd64 5.7.24-0ubuntu0.18.10.1 [2,302 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 mysql-client all 5.7.24-0ubuntu0.18.10.1 [9,832 B]
Fetched 7,271 kB in 5min 7s (23.7 kB/s)                                       
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/liba/libaio/libaio1_0.3.111-1_amd64.deb  Temporary failure resolving 'us.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

再安装的MySQL的服务端,核心程序(安装过程较长,省略展示)

[root@master:~]  sudo apt-get install mysql-server
[sudo] password for chujun: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 ...
[root@master:~] 

安装结束后,用命令验证是否安装并启动成功:sudo netstat -tap | grep mysql,然后看见了报错(o(╥﹏╥)o)

[root@master:~]  sudo netstat -tap | grep mysql
sudo: netstat: command not found

然后继续百度......,发现是没有安装的net-tools工具,默默安装

[root@master:~] sudo apt-get install net-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  net-tools
0 upgraded, 1 newly installed, 0 to remove and 73 not upgraded.
Need to get 197 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-2ubuntu1 [197 kB]
Get:1 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-2ubuntu1 [197 kB]
Fetched 18.9 kB in 1min 56s (163 B/s)                                         
Selecting previously unselected package net-tools.
(Reading database ... 165706 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-2ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...
[root@master:~] sudo netstat -tap | grep mysql
tcp        0      0 localhost:mysql         0.0.0.0:*               LISTEN      29674/mysqld        
[root@master:~] 

大功告成!果然新搭建的LIUNX系统干净的像一张白纸,要坚持在学习的道路上持之以恒的走啊走~~

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值