日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ubuntu安装mysql5.7.17_ubuntu 16.04安装mysql-server_5.7.17

發布時間:2025/3/12 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu安装mysql5.7.17_ubuntu 16.04安装mysql-server_5.7.17 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在MySQL官網上下載最新版的Ubuntu?Linux專用的MySQL。我這里下載的是:

mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar

也可從以下mirrors下載:

解壓文件 命令為:

root@ubuntu:/#?tar?-zxvf mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar?-C?./opt/

解壓開來后,一共有11個deb包,用sudo dpkg -i [包名]命令逐個安裝,因為包與包中間存在依賴關系,這里安裝有個先后順序。

-rw-r--r--??1?7155?31415????841472?Nov?28?05:50?libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415???1189512?Nov?28?05:50?libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415??17383814?Nov?28?05:50?libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415?????12644?Nov?28?05:50?mysql-client_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415?????71282?Nov?28?05:50?mysql-common_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415??????6815?Nov?28?05:50?mysql-community_5.7.17-1ubuntu16.04_amd64.changes

-rw-r--r--??1?7155?31415???7357222?Nov?28?05:50?mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415??24698654?Nov?28?05:50?mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415?133305884?Nov?28?05:50?mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415??23384678?Nov?28?05:50?mysql-community-test_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415?????12636?Nov?28?05:50?mysql-server_5.7.17-1ubuntu16.04_amd64.deb

-rw-r--r--??1?7155?31415?????12652?Nov?28?05:50?mysql-testsuite_5.7.17-1ubuntu16.04_amd64.deb

我的安裝的順序是:

1.mysql-common_5.7.17-1ubuntu16.04_amd64.deb

2.libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb

3.libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb

4.libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb

5.mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb

6.mysql-client_5.7.17-1ubuntu16.04_amd64.deb

7.mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb

這里需要再安裝一個依賴包叫libmecab2,安裝好后,繼續安裝最后一個:

8.mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb

安裝過程中需要設置數據庫密碼。

到這里,所有的已經安裝完畢。輸入Mysql -u root -p可以登陸數據庫了。

mysql簡單安裝方式:

1. sudo apt-get install mysql-server

2. apt-get isntall mysql-client

3.? sudo apt-get install libmysqlclient-dev

安裝過程中會提示設置密碼什么的,注意設置了不要忘了,安裝完成之后可以使用如下命令來檢查是否安裝成功:

sudo netstat -tap | grep mysql

通過上述命令檢查之后,如果看到有mysql 的socket處于 listen 狀態則表示安裝成功。

登陸mysql數據庫可以通過如下命令:

mysql -u root -p

-u 表示選擇登陸的用戶名, -p 表示登陸的用戶密碼,上面命令輸入之后會提示輸入密碼,此時輸入密碼就可以登錄到mysql。

然后通過 show databases; 就可以查看當前的數據庫。

我們選擇 mysql數據庫就行下一步操作,使用use mysql 命令,顯示當前數據庫的表單:show tables;

mysql>?create?database?mydatabase;

Query?OK,?1?row?affected?(0.00?sec)

mysql>?use?mydatabase;

Database?changed

mysql>?source?./mysql.sql

Query?OK,?0?rows?affected,?1?warning?(0.00?sec)

Query?OK,?0?rows?affected?(0.00?sec)

Query?OK,?0?rows?affected?(0.33?sec)

Records:?0??Duplicates:?0??Warnings:?0

Query?OK,?0?rows?affected,?1?warning?(0.00?sec)

Query?OK,?0?rows?affected?(0.00?sec)

Query?OK,?0?rows?affected,?1?warning?(0.00?sec)

Query?OK,?0?rows?affected?(0.04?sec)

Query?OK,?0?rows?affected,?1?warning?(0.00?sec)

Query?OK,?0?rows?affected?(0.00?sec)

mysql>?show?tables;

dpkg安裝出現的問題:

安裝mysql server時產生軟件依賴問題:

mysql-community-server depends on apparmor; however:

Package apparmor is not installed.

mysql-community-server depends on libmecab2 (>= 0.996-1.2ubuntu1); however:

Package libmecab2 is not installed.

那就先安裝上:

sudo apt -get install libmecab2

然后mysql-community-server,mysql-server就能正常使用了

在ubuntu下安裝任何軟件都提示以下錯誤:

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

kate : Depends: kdelibs4c2a (>= 4:3.5.9) but it is not going to be installed

Depends: libqt3-mt (>= 3:3.3.8b) but it is not going to be installed

Recommends: kregexpeditor but it is not installable

kscope : Depends: kdelibs4c2a (>= 4:3.5.7-1) but it is not going to be installed

Depends: libaudio2 but it is not going to be installed

Depends: libqt3-mt (>= 3:3.3.8really3.3.7) but it is not going to be installed

Depends: cscope but it is not going to be installed

Depends: exuberant-ctags but it is not going to be installed

Depends: graphviz but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

解決方法:

刪除提示的kate和kscope兩個未完全安裝的軟件。

$sudo dpkg --purge?kate

$sudo dpkg --purge kscope

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的ubuntu安装mysql5.7.17_ubuntu 16.04安装mysql-server_5.7.17的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。