Ubuntu?18.04.4安裝mysql的過(guò)程詳解?親測(cè)可用
下面看下Ubuntu 18.04.4安裝mysql的過(guò)程,內(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 (我的選項(xiàng)) #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 (我的選項(xiàng)) #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 (我的選項(xiàng)) #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 (我的選項(xiàng)) #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 (我的選項(xiàng)) 4 systemctl status mysql.service # 檢查服務(wù)器狀態(tài)
4 systemctl status mysql.service # 檢查服務(wù)器狀態(tài)
running代表無(wú)問(wèn)題

5 修改mysql 端口號(hào)以及將監(jiān)聽(tīng)地址改為所有 vim /etc/mysql/mysql.conf.d/mysqld.cnf # 編輯配置文件 bind-address = 0.0.0.0 #將監(jiān)聽(tīng)ip修改為所有 port = 3388 # 監(jiān)聽(tīng)端口修改為3388,可以不改我這是為了安全 修改完畢之后重啟服務(wù) systemctl restart mysql.service
6 開(kāi)放mysql遠(yuǎn)程訪問(wèn) 1 登錄數(shù)據(jù)庫(kù) mysql -u root -p 2 切換到數(shù)據(jù)庫(kù)mysql use mysql 3 刪除匿名用戶 delete from user where user=''; 4 增加允許遠(yuǎn)程訪問(wèn)的用戶或者允許現(xiàn)有用戶的遠(yuǎn)程訪問(wèn) 給root授予在任意主機(jī)(%)訪問(wèn)任意數(shù)據(jù)庫(kù)的所有權(quán)限 mysql> grant all privileges on *.* to 'root'@'%' identified by '這里替換成你想要設(shè)置的密碼' with grant option; flush privileges; 5 退出數(shù)據(jù)庫(kù) mysql> exit 6 重啟數(shù)據(jù)庫(kù) sudo service mysql restart
到此這篇關(guān)于Ubuntu 18.04.4安裝mysql的過(guò)程詳解 親測(cè)可用的文章就介紹到這了,更多相關(guān)Ubuntu 18.04.4安裝mysql內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
MySQL數(shù)據(jù)庫(kù)Shell import_table數(shù)據(jù)導(dǎo)入
本文我們介紹一款高效的數(shù)據(jù)導(dǎo)入工具,MySQL Shell 工具集中的import_table,該工具的全稱是Parallel Table Import Utility,需要的朋友請(qǐng)參考下文2021-08-08
MySQL中IF語(yǔ)句的基礎(chǔ)及進(jìn)階用法
在Mysql數(shù)據(jù)庫(kù)中實(shí)現(xiàn)判斷功能有很多方式,具體又分為函數(shù)和if語(yǔ)句形式,下面這篇文章主要給大家介紹了關(guān)于MySQL中IF語(yǔ)句的基礎(chǔ)及進(jìn)階用法,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-01-01
避坑:Sql中?in?和not?in中有null值的情況說(shuō)明
這篇文章主要介紹了避坑:Sql中?in?和not?in中有null值的情況說(shuō)明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-07-07
Django+mysql配置與簡(jiǎn)單操作數(shù)據(jù)庫(kù)實(shí)例代碼
這篇文章主要介紹了Django+mysql配置與簡(jiǎn)單操作數(shù)據(jù)庫(kù)實(shí)例,需要的朋友可以參考下2017-07-07
最新MySql8.27主從復(fù)制及SpringBoot項(xiàng)目中的讀寫分離實(shí)戰(zhàn)教程
MySQL主從復(fù)制是一個(gè)異步的復(fù)制過(guò)程,底層是基于MySQL1數(shù)據(jù)庫(kù)自帶的二進(jìn)制日志功能,這篇文章主要介紹了最新MySql8.27主從復(fù)制及SpringBoot項(xiàng)目中的讀寫分離實(shí)戰(zhàn)教程,需要的朋友可以參考下2022-08-08
mysql 5.7.13 winx64安裝配置方法圖文教程(win10)
這篇文章主要為大家分享了mysql 5.7.13 winx64安裝配置方法圖文教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01
MySQL 中查詢 VARCHAR 類型 JSON 數(shù)據(jù)的問(wèn)題記錄
在數(shù)據(jù)庫(kù)設(shè)計(jì)中,有時(shí)我們會(huì)將 JSON 數(shù)據(jù)存儲(chǔ)在 VARCHAR 或 TEXT 類型字段中,本文將詳細(xì)介紹如何在 MySQL 中有效查詢存儲(chǔ)為 VARCHAR 類型的 JSON 數(shù)據(jù),感興趣的朋友一起看看吧2025-04-04

