sudo apt-get install mysql-server-5.7 # 安装mysql
apt install net-tools #安装
开启端口:更多参考https://blog.csdn.net/bigdata_mining/article/details/80699180
mysql 授权远程登录数据库现在本机上登录后执行语句 在使用远程连接
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‘;
刷新权限:flush privileges;
退出数据库:quit;
本地连接:mysql -h localhost -u root -p123.
use mysql
SELECT User,authentication_string,plugin,`Host`
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
原文:https://www.cnblogs.com/zeng-qh/p/11696029.html