如何在Ubuntu18.04系統(tǒng)安裝mysql
MySQL是一個開源的小型關聯(lián)式資料庫管理系統(tǒng).在Ubuntu18.04系統(tǒng)中,如何安裝mysql?本文將針對此問題進行說明。
1.首先更新軟件列表
sudo apt-get update
2.然后安裝mysql-server
sudo apt-get install mysql-server
3.運行完之后輸入以下指令,可以查看mysql是否運行
service mysql status
反饋
Mysql正常運行
4.登錄mysql
mysql -u root -p
密碼為空,進入mysql
5.設置root賬號的密碼
依次運行以下命令
use mysql; update mysql.user set authentication_string=password('你的密碼') where user='root' and Host ='localhost'; update user set plugin="mysql_native_password"; flush privileges;
設置完成
6.查看debian-sys-maint用戶密碼
Ubuntu在安裝MySQL時會為用戶創(chuàng)建一個debian-sys-maint用戶。如果忘記密碼的話可以通過登錄debian-sys-maint用戶進行修改。
sudo cat /etc/mysql/debian.cnf
7.之后用該用戶密碼登錄后就可以修改root密碼了
mysql -u debian-sys-maint -p
版權保護: 本文「如何在Ubuntu18.04系統(tǒng)安裝mysql」由 云主機配置專家 原創(chuàng),轉(zhuǎn)載請保留鏈接: http://www.iqcg.cn/docs/system/1111.html