How to install mysql on ubuntu
First execute the following three commands:
sudo apt-get install mysql-server sudo apt install mysql-client sudo apt install libmysqlclient-dev
After the installation is successful, you can use the following commands Test whether the installation is successful:
sudo netstat -tap | grep mysql
The following information appears to prove the installation is successful:
You can enter the mysql service through the following command:
mysql -uroot -p你的密码
(Free learning video tutorial recommendation:mysql video tutorial)
Now set mysql to allow remote access, first edit the file /etc/mysql/mysql.conf.d/mysqld.cnf:
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Comment out bind-address = 127.0.0.1:
Save and exit, then enter the mysql service and execute the authorization command:
grant all on *.* to root@'%' identified by '你的密码' with grant option; flush privileges;
Then execute the quit command to exit the mysql service, and execute the following command to restart mysql:
sudo service mysql restart
Now you can use navicat to remotely connect to the mysql service under ubuntu under windows.
The above is the detailed content of How to install mysql on ubuntu. For more information, please follow other related articles on the PHP Chinese website!