sudo apt-get install mysql-server-5.7 # 安裝mysql mysql
apt install net-tools #安裝sql
開啓端口:更多參考https://blog.csdn.net/bigdata_mining/article/details/80699180數據庫
mysql 受權遠程登陸數據庫如今本機上登陸後執行語句 在使用遠程鏈接vim
sudo mysql use mysql; update user set authentication_string=PASSWORD("你的密碼") where User='root'; update user set plugin="mysql_native_password"; flush privileges; quit;
update user set host = '%' where user = 'root'; bash
刷新權限:flush privileges;服務器
退出數據庫:quit;tcp
本地鏈接:mysql -h localhost -u root -p123.ui
use mysql.net
SELECT User,authentication_string,plugin,`Host`3d
FROM `user`;
修改配置文件
vim /etc/mysql/mysql.conf.d/mysqld.cnf
查看MySQL進程:ps -ef | grep mysql
檢查MySQL的狀態:sudo service mysql status
開啓MySQL服務器:sudo service mysql start
關閉MySQL服務器:sudo service mysql stop
重啓mysql服務:service mysql restart
卸載Mysql
sudo apt purge mysql-*
以後執行Y