The MySQL on Ubuntu10.04 is executed.
Root @ ubuntu :~ # Sudo apt-get install mysql
After installing mysql-server
Start mysql
Root @ ubuntu :~ #/Etc/init. d/mysql start
You can connect to the database locally.
Root @ ubuntu :~ # Mysql-uroot-p
Set the remote access permission:
Mysql> grant all PRIVILEGES on *. * to admin @ '%' identified by '123 ′;
Query OK, 0 rows affected (0.04 sec)
Mysql> use information_schema
Mysql> select * from user_privileges;
The following result is displayed: admin' @ %, indicating that mysql has authorized remote connection.
Accessing the Ubuntu database in windows cannot be connected, but apache installed on Ubuntu can be accessed.
You cannot access port 3306 after using iptalbes.
Root @ ubuntu :~ # Iptables-a input-p tcp-dport 3306-j ACCEPT
View Mysql network connection on Ubuntu:
Root @ ubuntu :~ # Netstat-an | grep 3306
Tcp 0 0 127.0.0.1: 3306 0.0.0.0: * LISTEN
The local port is also listening.
Root @ ubuntu :~ # Ufw status
Firewall not loaded
The local firewall is not enabled.
Then I found a solution on the Internet:
View/etc/mysql/my. after cnf finds bind-address, it finds that 127.0.0.1 (bind-address = 127.0.0.1) is configured. Change it to bind-address = 192.168.0.xxx (local ip address), and then check that port 3306 is enabled, OK. The connection is normal.