Home  >  Article  >  Database  >  How to install mysql on ubuntu

How to install mysql on ubuntu

angryTom
angryTomOriginal
2020-02-21 18:08:282818browse

How to install mysql on ubuntu

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:

How to install mysql on ubuntu

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:

How to install mysql on ubuntu

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn