欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Ubuntu?18.04.4安裝mysql的過程詳解?親測可用

 更新時間:2022年01月08日 11:20:08   作者:xiaopeng_thriller  
這篇文章主要介紹了Ubuntu?18.04.4安裝mysql-親測可用,本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

下面看下Ubuntu 18.04.4安裝mysql的過程,內(nèi)容如下所示:

1 sudo apt-get update
2 sudo apt-get install mysql-server
3 sudo mysql_secure_installation # 初始化配置
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N (我的選項)
#2
Please set the password for root here...
New password: (輸入密碼)
Re-enter new password: (重復(fù)輸入)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (我的選項)
#4
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (我的選項)
#5
By default, MySQL comes with a database named 'test' that
anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (我的選項)
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (我的選項)
4 systemctl status mysql.service # 檢查服務(wù)器狀態(tài)
4 systemctl status mysql.service # 檢查服務(wù)器狀態(tài)

running代表無問題

5 修改mysql 端口號以及將監(jiān)聽地址改為所有

 vim /etc/mysql/mysql.conf.d/mysqld.cnf # 編輯配置文件
 bind-address            = 0.0.0.0  #將監(jiān)聽ip修改為所有
 port            = 3388  # 監(jiān)聽端口修改為3388,可以不改我這是為了安全
修改完畢之后重啟服務(wù)
systemctl restart mysql.service 
6 開放mysql遠程訪問
1 登錄數(shù)據(jù)庫
mysql -u root -p

2 切換到數(shù)據(jù)庫mysql
use mysql
3 刪除匿名用戶
delete from user where user='';
4 增加允許遠程訪問的用戶或者允許現(xiàn)有用戶的遠程訪問
給root授予在任意主機(%)訪問任意數(shù)據(jù)庫的所有權(quán)限
mysql> grant all privileges on *.* to 'root'@'%' identified by '這里替換成你想要設(shè)置的密碼' with grant option;
flush privileges;
5 退出數(shù)據(jù)庫
mysql> exit
6 重啟數(shù)據(jù)庫
sudo service mysql restart

到此這篇關(guān)于Ubuntu 18.04.4安裝mysql的過程詳解 親測可用的文章就介紹到這了,更多相關(guān)Ubuntu 18.04.4安裝mysql內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論