1、安装Mysql sudo apt-get install mysql-server sudo apt-get install mysql-client sudo apt-get install libmysqlclient-dev 2、修改root密码 sudo more /etc/mysql/debian.cnf 用文件里的用户名密码登陆Mysql use mysql update user set plugin=‘mysql_native_password‘ where user=‘root‘; update user set authentication_string=password(‘123‘) where user=‘root‘; flush privillege; 3、配置远程访问 注释掉在/etc/MySQL/mysql.conf.d/mysqld.cnf里面的bind-address = 127.0.0.1 连接mysql数据库,修改user表 Grantall on *.* to ‘root‘@‘%‘ identifiedby ‘root用户的密码‘ withgrant option;flush privileges;
原文地址:https://www.cnblogs.com/duanlinxiao/p/10202236.html
时间: 2024-12-16 15:29:02