Install mysql for Linux Ubuntu

Here mainly refer to the article: blog.csdn.net/itxiaolong3… If you are interested, you can go and have a look. Let me write down my process here

Environment: Ubuntu 18

Enter three installation commands:

If there is any [Y/n] that needs to be entered

Type y and press Enter

sudo apt-get install mysql-server
sudo apt install mysql-client
sudo apt install libmysqlclient-dev
Copy the code

After the installation, check whether our files are installed

sudo netstat -tap | grep mysql
Copy the code

Enter the above command to see the following figure, indicating that the installation has been successful

Mysql > create remote control

Edit the mysqld. CNF configuration file

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Copy the code

Enter I: Go to edit, move the cursor to the position we specified, use # to put the first comment, then press Esc: Exit editing mode Enter ZZ (uppercase) to save the Settings and exit

We try to enter mysql mode on the server



Note: -p is not followed by Spaces

Mysql -uroot -p your passwordCopy the code

Authorized Remote Service

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your password' WITH GRANT OPTION;Copy the code

When we see the input, we get Query OK, 0 rows and so on,

Continue typing to refresh the configuration naming

flush privileges;   
Copy the code

Next press Exit to exit

exit
Copy the code

Finally, restart our mysql service and we can go outside to use the client connection tool to check

service mysql restart
Copy the code

Install mysql for Linux Ubuntu. Thank you for your leadership

Welcome to qq group communication: 704028989