1泻轰, 打開終端:
sudo apt-get install mysql-server
2 技肩,接下來會(huì)讓你選擇y/n, 這里你選擇y,
3 且轨,這里會(huì)出現(xiàn)一個(gè)讓你輸入mysql-server的密碼浮声,輸入完后如果鼠標(biāo)點(diǎn)擊不了,可以使用Tab鍵+enter鍵繼續(xù)下一步
4 旋奢,接下來泳挥,會(huì)繼續(xù)讓我們輸入一次密碼
5, 密碼輸入完后至朗,我們這里的mysql-server的用戶名是:root 屉符,密碼是我們剛剛設(shè)置過的密碼,
6锹引, 這時(shí)候已經(jīng)安裝完成了矗钟,我們需要驗(yàn)證一下是否安裝上了mysql-server
mysql -u root -p
按enter鍵后會(huì)讓我們輸入密碼,當(dāng)我們輸入密碼后嫌变,會(huì)出現(xiàn):
snakeson@snakeson-Inspiron-5421:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
7 吨艇, 這樣我們就在Ubuntu下安裝好了mysql-server。