1. 安装MySQL的jar

root@computer-PowerEdge-T30:~# sudo apt-get install mysql-server mysql-client
在本次安装中,根据其提示输入密码

2. 测试是否安装成功

root@computer-PowerEdge-T30:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.59-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql>
进入则表明安装成功

3. 配置远程访问

配置你本机的ip地址和端口号

配置字符

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> set character_set_database=utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> set character_set_server=utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

4. 创建用户并授权

create user test identified by '123456';
grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option;
 

最新文章

  1. 定时任务-在spring中配置quartz
  2. SRS用列建模
  3. 如何在 Laravel 中使用 SMTP 发送邮件(适用于 163、QQ、Gmail 等)
  4. 【原创】Algorithms:原地归并排序
  5. *.bz2和*.gz分别是什么压缩格式
  6. 32位汇编第五讲,逆向实战干货,(OD)快速定位扫雷内存.
  7. 翻译:man getopt(1)中文手册
  8. 9.6 翻译系列:数据注解之Index特性【EF 6 Code-First系列】
  9. day_5.17 飞机大战
  10. 训练 の Bessie的体重问题
  11. JavaBasic_07
  12. effective C++学习二(仅供个人学习记录,本文摘录effective C++)
  13. poj_2709 贪心算法
  14. Scrum 项目准备3.0
  15. leetcode-Maximum Product Subarray-ZZ
  16. C++常用的系统函数
  17. linux2.6内核netfilter架构分析
  18. php 防止刷新重复下载文件
  19. Laravel 5.1 Blade模板引擎
  20. Python序列类型各自方法

热门文章

  1. Numbers Exchange
  2. jQuery.validator.addMethod方法的使用
  3. 怎么在Ubuntu下设置程序的快捷键
  4. XMLHttpRequest的用法
  5. 767. Reorganize String
  6. poj3276 Face The Right Way
  7. CF438E The Child and Binary Tree(生成函数+多项式开根+多项式求逆)
  8. JDK1.7 和 jetty配置教程
  9. vmware vSAN 入门
  10. Requests 入门