1.安装MYSQL:
[email protected]:~# sudo apt-get install mysql-server [email protected]:~# apt isntall mysql-client [email protected]:~# apt install libmysqlclient-dev
2.开启远程访问:
编辑mysql的配置文件:root@ubuntu:~# vi /etc/mysql/mysql.conf.d/mysqld.cnf,找到bind-address = 127.0.0.1这一行,注释该行
进入mysql:root@ubuntu:~# mysql -u root -p123456
在mysql中执行以下命令:
grant all on *.* to [email protected]‘%‘ identified by ‘123456‘; flush privileges;
退出mysql: exit;
最后在终端中重启mysql:
[email protected]:~# /etc/init.d/mysql restart
时间: 2024-10-14 16:29:12