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