ubuntu16.04 the installation and uninstallation of MySQL.

Source: Internet
Author: User
Tags mysql commands

First, the use of the MySQL database on Windows, to Linux is not very familiar with, this also as a record of their own.

First, the MySQL official also gave two installation methods:

One: Download the form of the installation package,

Because I personally think this is more troublesome, it is not used this way, if there is a way to take a look at other tutorials.

II: Installation with APT

This is how I installed myself: first open terminal, ctrl+alt+t shortcut

Then enter the following command:

sudo apt-get install mysql-server (official)

The installation process will also pop up a few conversations, one is to set up their own database root password, this password and ubunturoot password is not the same,

There is also the strength of the password, generally select the full number of that is OK, and delete the anonymous login database or something.

After installation in the terminal input: Mysql-uroot-p press ENTER, you will be prompted to enter the root password, this password is the root password you set before,

You can also go directly to MySQL by adding a password directly behind p.

Some other commonly used commands are:

sudo service MySQL status/view server status

sudo service MySQL start/start server

sudo service MySQL restart/restart server

sudo service MySQL stop/shutdown server

Second, if you want to use the database connection tool on other systems, such as navicat, and so on to connect the database, you need to set up

Terminal input: sudo vim/etc/mysql/mysql.conf.d/mysqld.cnf, press I to edit find Bind-address =127.0.0.1 in front of him with the # character commented out, so that any IP can be connected to come in, You can also specify an IP to replace this 127.0.0.1. Press ESC to exit Edit, enter: wq! Can. Restart the server again.

Then log in to MySQL input grant all privileges on * * to root ' @ '% ' identified by ' your own root password ' with GRANT option;

Exit the database exit.

Restart the database again.

Three

Some MySQL commands, show databases, view database, use + database name, using a database, show tables, view data table, desc table_ table name, view table structure.

ubuntu16.04 the installation and uninstallation of MySQL.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.