Getting started with the Ubuntu 16.04 installation of MySQL server

Source: Internet
Author: User

1, installation Mysql-server

-"sudo apt-get install Mysql-server

You can enter the root password

2. Modify Server Configuration

Default mysql-server only native access, new version of MySQL configuration file location changes.

-"CD/ETC/MYSQL/MYSQL.CONF.D

-"VI mysqld.cnf

Bind-address = 127.0.0.1//Find this content and comment

For security reasons, we recommend that you also modify the value of port ports. If the default port is used, it is possible to be attacked by someone in a malicious scan.

3. There are two ways of starting MySQL

-"service MySQL start//Use service command Services"

-"/etc/inint.d/mysql start//start with mysqld script"

When using Client remote Connection Report exception: 2003 can ' t connect MySQL server on ' xxxxxxx '.

The reason is that your account is not supported for Telnet, by default only on localhost. At this point, you will need to log in to MySQL to install that machine, log in MySQL, change the "MySQL" Database in the "User" table "host", from "localhost" to "%"

-"Mysql-u root-p//Enter the password into MySQL operation

-mysql-"Show databases;

-mysql-"use MySQL; Toggle Data Source

-mysql-"Update user set host = '% ' where user = ' root ';

Add a new account

CREATE USER ‘帐号‘ @ ‘%‘ IDENTIFIED BY ‘密码‘ ;  //% 表示任何远程能访问
Need to re-authorize: GRANT privileges ON databasename.tablename TO ‘username‘ @ ‘host‘ 说明: privileges - 用户的操作权限,如SELECT , INSERT , UPDATE 等(详细列表见该文最后面).如果要授予所的权限则使用ALL.;databasename - 数据库名,tablename-表名, 如果要授予该用户对所有数据库和表的相应操作权限则可用*表示, 如*.*.Cases: GRANT ALL ON db.* TO ‘admin‘@‘%‘;

Getting started with the Ubuntu 16.04 installation of MySQL server

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.