ubuntu下远程连接数据库

  • apt-get 安装
  • 源码安装
    • ./configure --prefix=/usr/local/ --with-名字=路径
    • make
    • make install
  • dkpg安装 debain

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev

service mysql start

ps -aux | grep mysql
netstat -ntlp | grep 3306

vim /etc/mysql/mysql.conf.d/mysqld.cnf

bind-address 127.0.0.1 改为 0.0.0.0
service mysql restart

mysql -u root -p

mysql> grant all on . to 'root'@'%' identified by '123456' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

windows 上面 就可以使用 navicat 连接 远程数据库

你可能感兴趣的:(ubuntu下远程连接数据库)