阿里雲(二)Ubuntu系統下mysql安裝

2021-07-30 06:14:50 字數 2833 閱讀 4264

一、ssh登入阿里雲伺服器,檢視是否安裝了mysql。(除非之前安裝過,一般沒有安裝)

root@izwz96t1p8ke0a4l01771vz:~# sudo netstat -tap | grep mysql

root@izwz96t1p8ke0a4l01771vz:~# 

出現以上情況,則表明沒有安裝資料庫

二、安裝mysql資料庫。

1、輸入下面指令,進行安裝。

root@izwz96t1p8ke0a4l01771vz:~# sudo apt-get install mysql-server mysql-client

2、安裝過程出現下面介面,進行設定密碼即可。

3、安裝完成,測試。

root@izwz96t1p8ke0a4l01771vz:~# mysql --version

三、資料操作指令。

1、mysql開啟狀態。

root@izwz96t1p8ke0a4l01771vz:~# service mysql status ●

mysql.service - mysql community server

loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)

active:

active (running)

since sat 2017-04-08 11:52:20 cst; 5min ago

main pid: 24520 (mysqld)

cgroup: /system.slice/mysql.service

└─24520 /usr/sbin/mysqld

apr 08 11:52:18 izwz96t1p8ke0a4l01771vz systemd[1]: starting mysql community server...

apr 08 11:52:20 izwz96t1p8ke0a4l01771vz systemd[1]: started mysql community server.

2、開啟/關閉資料庫。

root@izwz96t1p8ke0a4l01771vz:~# service mysql stop

root@izwz96t1p8ke0a4l01771vz:~# service mysql status

● mysql.service - mysql community server

loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)

active: inactive (dead) since sat 2017-04-08 11:59:30 cst; 12s ago

main pid: 24520 (code=exited, status=0/success)

apr 08 11:52:18 izwz96t1p8ke0a4l01771vz systemd[1]: starting mysql community server...

apr 08 11:52:20 izwz96t1p8ke0a4l01771vz systemd[1]: started mysql community server.

apr 08 11:58:55 izwz96t1p8ke0a4l01771vz systemd[1]: started mysql community server.

apr 08 11:59:29 izwz96t1p8ke0a4l01771vz systemd[1]: stopping mysql community server...

apr 08 11:59:30 izwz96t1p8ke0a4l01771vz systemd[1]: stopped mysql community server.

root@izwz96t1p8ke0a4l01771vz:~# service mysql start

root@izwz96t1p8ke0a4l01771vz:~# service mysql status ●

mysql.service - mysql community server

loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)

active:

active (running)

since sat 2017-04-08 12:00:17 cst; 8s ago

process: 24689 execstartpost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/success)

process: 24680 execstartpre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/success)

main pid: 24688 (mysqld)

cgroup: /system.slice/mysql.service

└─24688 /usr/sbin/mysqld

apr 08 12:00:16 izwz96t1p8ke0a4l01771vz systemd[1]: starting mysql community server...

apr 08 12:00:17 izwz96t1p8ke0a4l01771vz systemd[1]: started mysql community server.

ubuntu在terminal下安裝mysql

安裝的時候。僅僅須要在terminal 中輸入下面幾條命令 1.sudo apt get install mysql server 2.apt get isntall mysql client 3.sudo apt get install libmysqlclient dev 然後就能夠輸入下面命令...

阿里雲ubuntu配置

在使用阿里雲esc伺服器時遇到了一些問題,在此把整個過程從頭到尾敘述一遍,以供參考。1.初始系統無圖形化桌面 2.圖形介面只有guest 3.初始賬戶為root,不適用於普通使用,新增新賬戶 4.ssh及xrdp配置 5.其他配置 bin bash 更新軟體庫 apt get update 安裝ub...

阿里雲UBUNTU 12下安裝LAMP

要安裝的安裝包列表為 sudo apt get install apache2 mysql server mysql client php5 php5 gd php5 mysql關於安裝的過程請參考 在阿里雲主機 unbutu 12 預設安裝 apt get install php5 安裝的php5...