Home > Database > Mysql Tutorial > How to install mysql on ubuntu

How to install mysql on ubuntu

angryTom
Release: 2020-02-21 18:08:28
Original
2879 people have browsed it

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
Copy after login

After the installation is successful, you can use the following commands Test whether the installation is successful:

sudo netstat -tap | grep mysql
Copy after login

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你的密码
Copy after login

(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
Copy after login

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;
Copy after login

Then execute the quit command to exit the mysql service, and execute the following command to restart mysql:

sudo service mysql restart
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template