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.